Title bar becomes taller when using unicode

Tried switching locale to en_US.UTF-8, and this results in a taller title bar than what is necessary. This is probably just because fvwm now calculates the required height based on a large set of characters (even though the font is ISO-8859-1 - the font system probably fetches glyphs from other (bigger?) fonts for characters outside 0x00 - 0xff). Since I don’t need the title bar to display anything outside ISO-8859-1, I don’t want the extra height, and tried forcing it back down using TitleStyle Height XX. This works, but now the text is clipped from below because fvwm appears to draw it from the top and down.

Finally to my question: Is it possible to shift the text vertically by a few pixels? I don’t mind clipping of the unicode symbols that are too big (chances are I’ll never use them anyway), I just want the ISO-8859-1 range of characters to be vertically centered, like before. If I could just instruct fvwm to place the text at a negative offset, thus clipping from above, everything would be okay.

An easier approach would of course be to avoid using UTF-8 in fvwm, but launching fvwm as “LANG=en_US fvwm” also removes UTF-8 for all applications started directly by fvwm. I don’t care which of the approaches is used, so if it is easier to counter this than adjusting the font’s vertical position, then I’m happy.

This has been a known problem for ages, and TitleHeight tends to sort it out.

– Thomas Adam

TitleHeight? I grepped the entire source tree for that keyword, and not a single hit.

Sorry: TitleStyle Height foo

But thanks for playing.

Ah, as you can see in my original post, I already know about TitleStyle Height, and the actual question was about fixing problems caused by using this option. :slight_smile:

Yeah, I saw that. But there isn’t. You could try not setting it and allowing the font height to define the height of the title. Other than that, ask on the fvwm-workers mailing list.

– Thomas Adam

There’s a patch called TextOffset here:


I have no idea if it works or how clean or stable it is. I never used it. But it might be a temporary workaround.

This probably won’t work, since the height will still be relative. I would still ask on the fvwm-workers mailing list.

– Thomas Adam

I created an ugly patch that seems to work for me. It is included below, in case other people are interested. Quite simply, I just recalculate the title font’s height by temporarily setting the character locale to C before querying X about the font’s size. There’s no way something this sloppy is going to be merged into the offical tree, so I haven’t bothered posting it in fvwm-workers. :slight_smile:

[code]— fvwm-2.5.25/fvwm/geometry.c.orig 2007-06-03 11:28:34.000000000 +0200
+++ fvwm-2.5.25/fvwm/geometry.c 2008-03-09 13:34:41.000000000 +0100
@@ -251,6 +251,17 @@

/* adjust font offset according to height specified in title style */
decor_size = fw->decor->title_height;
  •    {
  •            char **ml, *ds;
  •            int mc;
  •            char *saved_locale = setlocale(LC_CTYPE, NULL);
  •            setlocale(LC_CTYPE, "C");
  •            XFontSet fontset = XCreateFontSet(dpy, fw->title_font->name, &ml, &mc, &ds);
  •            XFontSetExtents *fset_extents = XExtentsOfFontSet(fontset);
  •            setlocale(LC_CTYPE, saved_locale);
  •            fw->title_font->height = fset_extents->max_ink_extent.height;
  •            XFreeFontSet(dpy, fontset);
  •    }
    font_size = fw->title_font->height + EXTRA_TITLE_FONT_HEIGHT;
    switch (title_dir)

merged or not…I would suppose you ask in worker mailing list…there was probably a thread some days ago in the fvwm user mailing list about fvwm patches and it’s integration in fvwm…