Suggestion of patch for libXaw3d-1.6.1

Jean-Pierre Demailly Jean-Pierre.Demailly at
Sun Mar 4 13:51:04 PST 2012


Please find enclosed a suggestion of patch for libXaw3d-1.6.1 (actually 
for the current git version that has an additional one line bug fix), 
along with two new files Xaw3dXft.h and Xaw3dXft.c - you will also find 
a tarball of the patched version at

The main goal of this patch is to enable truetype fonts and UTF8 strings
in libXaw3d, using freetype routines (-lXft -lfontconfig required).

By default, libXaw3dXft-1.6.2 should behave exactly as libXaw3d-1.6.1 (with 
the minor one line bug fix already mentioned). More precisely, it should be 
completely upward source compatible with libXaw3d-1.6.1 (but probably not
binary compatible for apps using extensively the toolkit).

New features can be enabled by setting ad hoc parameters, the default 
values of which are :

char Xaw3dXftEncoding = 0;
char Xaw3dXftStringHilight = 0;
char Xaw3dXftStringUsePixmap = 0;
char Xaw3dXftMenuSpacing = 1;
char Xaw3dXftShowTips = 1;
char Xaw3dXftTipDoGrab = 1;
char Xaw3dXftBorderHack = 1;
char Xaw3dXftNoHilitReverse = 0;
char Xaw3dXftButtonInverse = 1;
char Xaw3dXftButtonDashed = 0;
char Xaw3dXftMultiColumnMenu = 0;

Pixel Xaw3dXftTipBackgroundColor = -1; /* disabled */
char * Xaw3dXftHilitColor = NULL;  /* disabled */
unsigned short Xaw3dXftInsensitiveTwist[4] = { 0, 0, 0, 0};  /* disabled */

char * Xaw3dXftDefaultFontName = NULL;
XftFont * Xaw3dXftDefaultFont = NULL;

The main parameter is Xaw3dXftEncoding. When it is set to 0, the X core font
protocol is used. When it is set to -1 (i.e. 255), freetype is used along
with utf8 encoding. Other values are
  Xaw3dXftEncoding = 8  ( 8 bit encodings with freetype)
  Xaw3dXftEncoding = 16 (16 bit encodings with freetype)

The fonts should be specified in fontconfig notation by setting the 
  *xftFont: XXXX
resource values (or by setting the global Xaw3dXftDefaultFontName which is
then used as the default font in case none is defined); freetype has the 
additional benefit of selecting a fallback font in case the selected
one does not exist or cannot be loaded.

Som apps using the modified library can be found at
Xpaint invokes almost all new features ; its look and fill is then
somewhat closer to what would give a GTK app, especially libXaw3dXft 
provides antialiased fonts and UTF8 strings throughout the GUI. Another
app that can be compiled that way is xtide-2.13-RC2-jpd.tar.bz2 (a very
slight modification of xtide-2.13-RC2 by David Flater); xtide shows an
example of multicolumn menus implementation (click on the year box
in the "set time" menu).

Notice that multicolumn menus are now available with plain libXaw, but not 
in libXaw3d which was forked before this feature was introduced in libXaw. 
In libXaw3dXft multicolumn menus only work when 
  Xaw3dXftNoHilitReverse = 1;
  Xaw3dXftMultiColumnMenu = 1;
are set (so they won't work in the default mode, some more changes
in the ThreeD routines would be needed for that).

Best regards,

Jean-Pierre Demailly
(xpaint developer/maintainer)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libxaw3d.patch
Type: text/x-diff
Size: 110895 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Xaw3dXft.h
Type: text/x-chdr
Size: 3685 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Xaw3dXft.c
Type: text/x-csrc
Size: 16007 bytes
Desc: not available
URL: <>

More information about the xorg-devel mailing list