[Fontconfig] Using Xft + pixel fonts?

Michael secure at twice-irc.de
Tue Mar 3 23:34:51 PST 2009

Hi there,

I'm currently developing an X application and in order to keep it small and
without lots of dependencies, I use Xft directly. The reason to use Xft is to
support UTF-8. I'm posting to this list because Xft uses fontconfig to select
fonts, if I've understood that correctly.

Now, I'm very much used to pixel fonts and, I think nobody will disagree with
me after examining this, pixel fonts clearly look better in small font sizes
as one needs them to work decently on a notebook. Therefore, I usually use a
font definition like the following for my terminals:

URxvt.font: -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso8859-1

After a bit of searching, I stumbled over the function XftFontOpenXlfd().

However, passing XftFontOpenXlfd() the XLFD I posted above, it simply does not
use the right font. If you want to, I can post two screenshots of how it looks
like and how it should look.

Then I took a peek at the URxvt sourcecode, which uses *both* APIs (Xft and Xlib)
to actually display fonts (they have a fallback mechanism for glyphs which are
not in your current font, it'll search a better font then). Now I'm wondering
if Xft is capable and intended to use XLFDs at all? Is one really supposed to
use the old Xlib functions in combination with Xft? If so, why?!

Best regards,

More information about the Fontconfig mailing list