freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FT_Set_Char_Size() with TrueType fonts


From: David Turner
Subject: Re: FT_Set_Char_Size() with TrueType fonts
Date: Tue, 31 Oct 2000 02:45:18 +0100

Hi Jeff,

> Hi Dave,
> 
> FT_Set_Pixel_Sizes works for the most part, but when I try to
> rasterize one of our chinese fonts, the resulting glyph bitmap
> is always 3-4 pixels larger than the size of the bitmap I specified
> using FT_Set_Pixel_Sizes(). Any ideas?
> 
Sure, actually this one deserves an entry in the FAQ :-)

the "character size", be it expressed in pixels or points, isn't
directly related to the exact dimensions of glyphs when rendering
text.

It's actually the size of the EM square (an abstract square symbol
used by font designers). The glyph dimensions are always relative to
the EM size, of course, but the "adjustment" factor depends entirely
on the font.

For example, try to print text at 12 points with three fonts like
"Arial", "Times New Roman" and "Courier New". Have a deep look at
the glyph dimensions, and you'll notice that the glyphs do not have
the same heights in distinct fonts..

Of course, bitmapped font formats tend to assume that
character size == ascent + descent, which is not normally the
case..

And in case you're wondering, there is _no_ reliable way to extract
certain metrics like the "X-height", "x-height", Latin ascent,
Latin descent, from font files.

This means you can't figure out bounding boxes easily without having
the scaled glyph metrics at hand.. :-(

Hope this helps,

- David

> Thanks,
> Jefff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]