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

RESOLVED FIXED in mozilla37

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jfkthame, Assigned: jfkthame)

Tracking

(Blocks: 1 bug)

unspecified
mozilla37
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
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)

Comment 1

4 years ago
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)

Updated

4 years ago
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8547078 - Flags: review?(smontagu) → review+
https://hg.mozilla.org/mozilla-central/rev/1269384028d0
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.