Comment 10 for bug 1450675

Revision history for this message
David Mathog (mathog) wrote :

On further consideration, I suggest that the OP contact the people who distribute "Harrington" and get them to fix the Ascender/Descender values. If they won't then find some tool to edit TT fonts and make the change locally.

Or better yet, use a font which isn't broken!

The relevant values in the tables for Harrington are:

Face Ascender: 750
Face Descender: -170
Face Height: 929
Face Bbox: xMin -430 xMax 3162 yMin -885 yMax 3080
Face UpEM: 4096
OS/2 version:2
OS/2 sTypoAscender: 750
OS/2 sTypoDescender: -170
OS/2 sTypoLineGap: 30
OS/2 line spacing: 950
OS/2 usWinAscent: 3080
OS/2 usWinDescent: 885
OS/2 Win line spacing: 3965

750 Ascender value is just wrong, compare it to yMax of 3080, that's why the font is cut in "half". (750 could have
been right if this was some special font meant to be written as squat little characters on a line.)

The sTypoAscender, sTypoDescender values are also wrong. The sum of sTypoAscender + sTypoDescender + sTypoLineGap
is supposed to be about 1 Em. Here it is 950 units, but Units per Em is 4096, so this is only about ~1/4 Em.

The usWinAscent and usWinDescent values correspond 1:1 with the bounding box y limits. This is correct for what those are:

https://www.microsoft.com/typography/otspec/os2.htm

Before the patch Inkscape used the font face bounding box, which is equivalent to the usWinAscent/usWinDescent. The patch stopped doing that because it provided poor information about where to place overline and underline, and that is needed for text decorations.

The issue with trying to work around the broken font is that even when Inkscape can guess with good probability that values are broken it may not be able to guess how to fix the issue. The sum sTypoAscender + sTypoDescender + sTypoLineGap is way off given unitsPerEm. Inkscape can only _guess_ what might be wrong, if all values are scaled wrong it could rescale them to a sum of about 1 em. But what if it is only sTypoAscender which is off? Or sTypoDescender?