TWM: truetype support

Eeri Kask Eeri.Kask at
Wed Sep 12 05:07:21 PDT 2007


Here is probably the right place to ask all twm users what do you think
about freetype font support in twm window manager in order to give it a
contemporary look?  :-)

Enclosed is a small patchset (against official 1.0.3 release) as a
prototypical proof of concept regarding this idea; how it would look
like one can see at

What I basically did, is

(1) shifted MyFont_ChangeGC() down into MyFont_DrawString() and
MyFont_DrawImageString() respectively (generally no problem,
PaintEntry() in menus.c needed closer attention);

(2) changed slightly menuitem color data in "struct MenuItem" and
"struct MenuRoot" for the sake of MyFont_DrawString() and
MyFont_DrawImageString() forwards/backwards interface compatibility in
regard to the current bitmapped font rendering.

(3) minor one-liner corrections here and there.

The heavy work is enclosed in "#ifdef XFT_SUPPORT" so if undefining you
can return to bitmapped rendering anytime (though, using the modified
MinuItem color interface).

The compiler needs CFLAGS to include

    -DXFT_SUPPORT -I/usr/include/freetype2

and the linker -lXft.

There is an extra bonus hidden for the curious, -DOPACITY_SUPPORT
activates twm-menu opacity feature if 'xcompmgr' is running in the
background (having X11-composite extension enabled).  :-)

So put

TitleFont	"sans-9"
MenuFont	"sans-9"
IconFont	"sans-9:bold"
IconManagerFont	"sans-9"
ResizeFont	"sans-10:bold"
DefaultFont	"mono-9"
MenuOpacity	235

into .twmrc and ... enjoy!


    Eeri Kask

P.S. I am aware this work is not finished/polished, so please help
complete designing MyFont_DrawString(), MyFont_DrawImageString()
interfaces! :-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: twm-1.0.3_xft_support-12Sept2007.tgz
Type: application/x-compressed-tar
Size: 9116 bytes
Desc: not available
URL: <>

More information about the xorg mailing list