Hi Frank,

Thank you! That did it... I'm not sure I would have figured this out on my own!

I had "LANG=en_US.UTF-8" set in my environment, which I picked up from the default Ubuntu login setup. If I run "env LANG=C twm" or "env LANG=en_US twm" the titlebuttons are scaled properly.

Overcome by curiosity, I started twm under a debugger to see what it was doing with the fonts, and I found this comment in util.c:

/*
 * The following functions are sensible to 'use_fontset'.
 * When 'use_fontset' is True,
 *  - XFontSet-related internationalized functions are used
 *     so as multibyte languages can be displayed.
 * When 'use_fontset' is False,
 *  - XFontStruct-related conventional functions are used
 *     so as 8-bit characters can be displayed even when
 *     locale is not set properly.
 */
void
GetFont(MyFont *font)
{

...

When "use_fontset" is true, the ascent and descent values are determined by the "max" ascent and descent of all the fonts in the set. For example, in the case I was looking at, the "fixed" font was an alias for 17 fonts, which included an "-arabic-newspaper-*" font that has an ascent==24 and descent==11. When "use_fontset" is false, twm does a straight-up by-name lookup of the font, which has an ascent==8 and descent==2.

Finally, as you observed, the locale controls the setting of "use_fontset":

    loc = setlocale(LC_ALL, "");
    if (!loc || !strcmp(loc, "C") || !strcmp(loc, "POSIX") ||
        !XSupportsLocale()) {
         use_fontset = False;
    } else {
         use_fontset = True;
    }

Cheers, John D.

Frank Steiner wrote:
John DelSignore wrote

  
 Hi,

I'm using twm on an Ubuntu 14.04 system, and for some reason depending
on the TitleFont I pick, the titlebuttons are much bigger than the
TitleFont. Below, I used the font "fixed" for the TitleFont, and the
titlebutton is much bigger than height of the font. Why is that happening?
    
Check your LC_CTYPE settings. When I use en_US.UTF-8 I get the same huge
titlebuttons while en_US works fine. Maybe it somehow depends of the font
you use, if it can handle utf8 encoding or not (just a guess).

cu,
Frank
  
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Reply via email to