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.
Created attachment 8547078 [details] [diff] [review] Use absolute value of vhea descender field, because fonts differ in the sign of the coordinate system they assume
Attachment #8547078 - Flags: review?(smontagu)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8547078 - Flags: review?(smontagu) → review+
Target Milestone: --- → mozilla37
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.