Bug 222340 - xterm -fa font size change anomaly (small becomes gigantic)
Summary: xterm -fa font size change anomaly (small becomes gigantic)
Alias: None
Product: Fedora
Classification: Fedora
Component: xterm
Version: 6
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Miroslav Lichvar
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2007-01-11 19:37 UTC by Kent Engström
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-02-06 17:19:45 UTC

Attachments (Terms of Use)
several fixes for font-switching (8.41 KB, patch)
2007-01-17 01:25 UTC, Thomas E. Dickey
no flags Details | Diff

Description Kent Engström 2007-01-11 19:37:53 UTC
Description of problem:

I use "xterm -fa Anonymous". After a recent upgrade of xterm,
when I use Ctrl and Right Mouse Button to select another font size
than default, such as Small, the font size used is gigantic.

Version-Release number of selected component (if applicable):


How reproducible:

Use "xterm -fa anytruetypefont". 

Use Ctrl and Right Mouse Button to select another font size
than default, such as Small.

Actual results: GIGANTIC font.

Expected results: A slightly smaller font.

Comment 1 Miroslav Lichvar 2007-01-12 13:17:47 UTC
Thanks for the report. CCing upstream xterm maintainer.

This has changed in xterm-217. Problem is that menu_font_size[0] is 0 when
computing face_size in xtermComputeFontInfo(). 

The size is also incorrect when shifting with control sequences, but is correct
with {smaller,larger}-vt-font().

Comment 2 Thomas E. Dickey 2007-01-12 13:35:06 UTC
It sounds (will check) as if I made it work for the
shifted keypad plus/minus, but overlooked something
in the direct menu-selection.  (I recall doing that
before - the initialization is almost the same but
not exactly).

Comment 3 Thomas E. Dickey 2007-01-15 01:22:30 UTC
Something like this is needed (will check further, but thought
this might be helpful):

RCS file: RCS/fontutils.c,v
retrieving revision 1.219
diff -u -r1.219 fontutils.c
--- fontutils.c 2006/11/29 21:57:00     1.219 
+++ fontutils.c 2007/01/15 01:20:08 
@@ -1493,6 +1493,7 @@ 
                 * but this is simpler than adding another resource value - and
                 * as noted above, the data for the fixed fonts are available.
+               lookupOneFontSize(screen, 0); 
                lookupOneFontSize(screen, fontnum);
                if (fontnum == fontMenu_fontdefault) {
                    face_size = 14.0;

Comment 4 Miroslav Lichvar 2007-01-15 11:41:27 UTC

There is another problem with the escape sequence when used with -fa option, the
font size is changed only once, other attempts are unsuccessful.

Comment 5 Thomas E. Dickey 2007-01-15 12:11:48 UTC
hmm: I don't see this discussing escape sequence, but thought
it was for the popup menus.  Those seemed to work more than
once (though I only tried 2-3 times after the initial change).
Can you provide more details?

Comment 6 Miroslav Lichvar 2007-01-15 13:10:52 UTC
It was for the popup menus, I just wrote in comment #1 that the bug was also
triggered with control sequence (OSC 5 0).

The comment #4 is about another, unrelated problem that I have noticed when
testing the patch. When -fa option is used, the font size can be changed with
the OSC control sequence only once.

Comment 7 Thomas E. Dickey 2007-01-15 13:50:35 UTC
thanks - I'll take a look at that (sounds like something

Comment 8 Thomas E. Dickey 2007-01-17 01:25:28 UTC
Created attachment 145764 [details]
several fixes for font-switching

Comment 9 Thomas E. Dickey 2007-01-17 01:26:49 UTC
I have several other items on my list for #224 (it would
be nice to get some feedback on this in the next week or

Comment 10 Miroslav Lichvar 2007-01-18 15:08:03 UTC
Thanks. The patch is in xterm-223-2.fc6.

Comment 11 Kent Engström 2007-01-23 19:52:39 UTC
I've downloaded xterm-223-2.fc6 from updates-testing and I can confirm
that the bug I reported is fixed. Thanks to both of you!

Note You need to log in before you can comment on or make changes to this bug.