[Q] xft recipe

Aidan Kehoe kehoea at parhasard.net
Fri Nov 2 12:22:14 EDT 2007


 Ar an dara lá de mí na Samhain, scríobh Didier Verna: 

 > I would like to give xft a try, but I can't manage to get something
 > close to my current font setting, which is like this (from XEmacs'xrdb file):
 > 
 > XEmacs.default.attributeFont: -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1
 >
 > XEmacs*font: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
 >
 > Can somebody give me a recipe for that (preferably in Lisp, otherwise,
 > as X resources) ?

This, in my ~/.Xdefaults:

#ifdef XEMACS_XFT
XEmacs.default.attributeFont: Courier-12
XEmacs*font: Helvetica-12:style=bold
#else
XEmacs.default.attributeFont: -adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1
XEmacs*font: -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
#endif

gives me two identical frames on my local machine, with one frame
belonging to an XEmacs build with server-side fonts and with X defaults
not reflecting XEMACS_XFT, and the other frame belonging to an XEmacs build
with Xft fonts and with X defaults reflecting XEMACS_XFT. This requires a)
that XFT believes that the display has the same DPI as does the X server and
b) that XFT has access to the same font files on disk. 

The fonts used by the menubars are not accessible from Lisp right now,
sorry. But for the default face, (set-face-font 'default nil "Courier-12")
should do the job. 

To check what DPI the X server-side fonts think your display has, try 

xdpyinfo | grep 'dots per inch'

To check what DPI the X client-side fonts think your display has, 

appres Xft

If that gives you a value for DPI, that’s what’s used by client-side fonts;
if it doesn’t, the server side DPI value will be used.

To check what font file XFT uses for a given pattern, try, for example, 

fc-match -v 'Helvetica-12:style=bold' | grep file

This gives file: "/usr/X11R6/lib/X11/fonts/75dpi/helvB12.pcf.gz" 
for me. When I grep for helvB12.pcf.gz in
/usr/X11R6/lib/X11/fonts/75dpi/helvB12.pcf.gz, I get this:

helvB12.pcf.gz -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso10646-1

which matches your server-side pattern sufficiently that I’m reasonably sure
it’s the same font. 

-- 
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)



More information about the XEmacs-Beta mailing list