freetype
[Top][All Lists]
Advanced

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

[ft] Working around a bad ascender value?


From: mathog
Subject: [ft] Working around a bad ascender value?
Date: Wed, 13 May 2015 13:44:59 -0700
User-agent: Roundcube Webmail/0.9.5

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
address@hidden
Manager, Sequence Analysis Facility, Biology Division, Caltech



reply via email to

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