Closed Bug 1120102 Opened 7 years ago Closed 7 years ago

inconsistency in the 'descender' field of 'vhea' tables

Categories

(Core :: Graphics: Text, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In some fonts with a 'vhea' table, the 'descender' field uses the same coordinate system as 'ascender', and therefore holds a negative value; but in other fonts, it is treated as an absolute distance from the baseline, and holds a positive value (intended to be measured in the opposite direction from the ascender).

This inconsistency means that we get a too-small line extent (as shown, for example, by selection highlighting) with a number of common fonts on Windows and Linux; e.g. TakaoPGothic.

As there is no reasonable use-case for a font to have a "negative descent" (meaning a descent that is on the same side of the baseline as the ascent), we can cater for both versions by simply using the absolute value of the descender field, and adding this to the ascender to get the total glyph extent.
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8547078 - Flags: review?(smontagu) → review+
https://hg.mozilla.org/mozilla-central/rev/1269384028d0
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.