[Fontconfig] Fontconfig 2.2.2 and Xft 2.1.4 released

Keith Packard keithp at keithp.com
Mon Mar 15 13:42:20 EST 2004


Around 23 o'clock on Mar 14, Adam Sampson wrote:

> I'm using FreeType 2.1.7 (upgraded just before I did fontconfig/libXft).

Well, the bdf/pcf handlers in that version are broken.  The basic problem 
is that someone had the bright idea of adding another set of metrics to 
measure bitmap instances with.  We used to have

	width		???
	height		'pixel height' of the face (basically point/72 * dpi)

Now we've got

	width		average 'width' value (spacing to next character)
	height		ascent + descent + leading?
	x_ppem		horizontal pixels in M square
	y_ppem		vertical pixels in M square

Note that 'new y_ppem' == 'old height' (an M square is generally defined by the 
nominal height of the face, with a bit of aspect ratio thrown in to whack 
the horizontal value)

The problem is the BDF/PCF loaders were matching sizes passed in against 
width/height instead of x_ppem/y_ppem.  But, the TTF loader matches x_ppem/
y_ppem.  It's just a bug in FreeType. I'm pretty sure it's been fixed 
since; I sent a detailed message to them explaining what I found

	http://www.freetype.org/pipermail/devel/2004-February/010140.html

And, as usual, they were quick to help out.

To "fix" the problem, you have to take the x_ppem/y_ppem values given to 
the font selector function and "know" to convert them to width/height 
values; that means detecting that the font is a BDF/PCF font, that the 
FreeType version has this bug and walking the bitmap table to convert the 
values across.

Simply backing out the matching code won't work.  The font sizes are now 
extracted from y_ppem/x_ppem values (which the BDF/PCF loaders set 
correctly).  Passing those values in raw will fail to match just as the 
current code fails now -- you can't send x_ppem/y_ppem values and expect 
the BDF/PCF loaders to find matching entries -- they're matching against 
width/height.

Probably the best solution would be to have Fontconfig check the version 
of FreeType and use width/height for really old versions (pre-x_ppem/
y_ppem) when finding out what sizes are available, and then map x_ppem/
y_ppem to width/height when using the BDF/PCF loader from the few versions 
of FreeType which were broken.

-keith


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/fontconfig/attachments/20040314/8ce84b5e/attachment.pgp


More information about the Fontconfig mailing list