Bug 222340

Summary: xterm -fa font size change anomaly (small becomes gigantic)
Product: [Fedora] Fedora Reporter: Kent Engström <kent>
Component: xtermAssignee: Miroslav Lichvar <mlichvar>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6CC: dickey
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-02-06 12:19:45 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Description Flags
several fixes for font-switching none

Description Kent Engström 2007-01-11 14:37:53 EST
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 08:17:47 EST
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 08:35:06 EST
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-14 20:22:30 EST
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 06:41:27 EST

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 07:11:48 EST
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 08:10:52 EST
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 08:50:35 EST
thanks - I'll take a look at that (sounds like something
Comment 8 Thomas E. Dickey 2007-01-16 20:25:28 EST
Created attachment 145764 [details]
several fixes for font-switching
Comment 9 Thomas E. Dickey 2007-01-16 20:26:49 EST
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 10:08:03 EST
Thanks. The patch is in xterm-223-2.fc6.
Comment 11 Kent Engström 2007-01-23 14:52:39 EST
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!