"Huw Davies" huw@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.