Greetings,

I am attempting to fix a bug in Inkscape related to the use of this
truetype font:

  http://www.1001freefonts.com/harrington.font

The bug is that a bounding box used when glyphs are drawn is roughly half the height of the glyphs, so they are cut off at the knees, so to speak.

After much debugging it was determined that the ascender and descender values returned by Freetype for the problem font are not good.

Ascender:750
Descender:-170
Bbox: xMin  -430 xMax  3162 yMin  -885 yMax  3080
UpEM: 4096

The ascender is much smaller than yMax, and the descender much greater than yMin. (The height value also looks wrong, it is only 929.) The values are small enough to account for the problem, because the bounding box in question is derived from the Ascender and Descender values.

For comparison, here are the same values for Arial (which like most fonts, works fine
with Inkscape)

Ascender:1854
Descender:-434
Bbox: xMin -1361 xMax  4154 yMin  -665 yMax  2124
UpEM: 2048

In the Freetype documentation there are references to sTypoAscender, which is said to be pretty reliable. However, I do not see how to retrieve this value through
the Freetype API.

How does one retrieve information from the OS/2 table (assuming one is present)?

Is there some other common workaround for this sort of problem?

Thank you,

David Mathog
[email protected]
Manager, Sequence Analysis Facility, Biology Division, Caltech

_______________________________________________
Freetype mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype

Reply via email to