Re: Add a test for bitmap font metrics to ensure that they match the Windows ones
On Fri, Mar 17, 2006 at 02:01:41PM +0800, Dmitry Timoshkov wrote:
"Huw D M Davies" <h.davies1(a)physics.ox.ac.uk> wrote:
Looks like this might be a fontforge or FreeType problem. Windows courier at 13 ppem should have an ascent of 11 and a descent of 2, which is what we have in the .sfd. Now, when I run sfnt2fnt on the generated .ttf I get an ascent of 13, ppem of 13 and hence a descent of 0.
I'm not going to have time to look into this soon, so please feel free to investigate more.
Looks like it's a sfnt2fnt bug and not a fontforge or FreeType problem.
This patch tests bitmap font metrics to ensure that they match the Windows ones. The patch discovers a bug in sfnt2fnt which causes Courier font to have wrong ascent and descent values (13/0 instead of 11/2). courier.ttf generated by fontforge from courier.sfd has correct values, but courier-*.fnt files have wrong values.
Well we get the ascent from the height of the Aring glyph. As far as I can tell this is 11 in fontforge. So somewhere between fontforge's export as a ttf and sfnt2fnt reading that ttf (using FreeType) the value has changed to 13. Hence my comment that either fontforge or FreeType is doing something odd. Huw. -- Huw Davies huw(a)codeweavers.com
"Huw Davies" <huw(a)codeweavers.com> wrote:
Looks like it's a sfnt2fnt bug and not a fontforge or FreeType problem.
This patch tests bitmap font metrics to ensure that they match the Windows ones. The patch discovers a bug in sfnt2fnt which causes Courier font to have wrong ascent and descent values (13/0 instead of 11/2). courier.ttf generated by fontforge from courier.sfd has correct values, but courier-*.fnt files have wrong values.
Well we get the ascent from the height of the Aring glyph. As far as I can tell this is 11 in fontforge. So somewhere between fontforge's export as a ttf and sfnt2fnt reading that ttf (using FreeType) the value has changed to 13. Hence my comment that either fontforge or FreeType is doing something odd.
I was going to point out that I tried to replace in tools/sfnt2fnt.c ascent = face->glyph->metrics.height >> 6; by ascent = face->size->metrics.ascender >> 6; which is what is used in dlls/gdi/freetype.c,get_bitmap_text_metrics(), but that breaks MS Sans Serif bitmap fonts. It looks like fontforge doesn't allow to have a different font header for each different bitmap size in the bitmap font. -- Dmitry.
participants (2)
-
Dmitry Timoshkov -
Huw Davies