Help figuring out font rendering, please?

joe M joe9mail at gmail.com
Fri Feb 15 07:04:25 PST 2013


Hello,

I am trying to figure out how font rendering works in X.

The app that I am debugging uses fontconfig calls to match the font
pattern string against the available fonts. Then, that font is
rendered using Xft (XftDrawStringUtf8).

With FC_DEBUG set, I can see that the correct font is being sent in
the call to XftDrawSTringUtf8. But, for some reason, the font
displayed by X is not the correct font. I understand that if a glyph
does not exist, xft falls back to a font which has a glyph.

While checking out XftDrawStringUtf8, I noticed this behaviour in a
lof of Xft code:

XftGlyphCore (XftDraw		*draw,
	      _Xconst XftColor	*color,
	      XftFont		*public,
	      int		x,
	      int		y,
	      _Xconst FT_UInt	*glyphs,
	      int		nglyphs)
{...
    XftFontInt	    *font = (XftFontInt *) public;

Where the XftFont is cast into XftFontInt. I noticed that the
structure definitions of XftFont and XftFontInt are very different.

That made me wonder if Xft is actually using the font supplied or if
it is just falling back to the font used by X or the fallback font all
the time.(?)

Any thoughts, please?

Thanks
Joe


More information about the xorg mailing list