Open Bug 914549 Opened 11 years ago Updated 2 years ago

Gecko does not respect the "typographic line metrics" from the OS/2 table, even when the USE_TYPO_METRICS flag is set

Categories

(Core :: Graphics: Text, defect)

defect

Tracking

()

People

(Reporter: jfkthame, Unassigned)

References

Details

When looking at the new Fira Sans and Fira Mono fonts in bug 897009, it has become apparent that Gecko does not respect the sTypo* fields in the 'OS/2' table[1] when computing default line-height, but instead uses the legacy ascent/descent/linegap values from the 'hhea' table and/or the usWinAscent/Descent values. This is the case even though the fonts have the USE_TYPO_METRICS flag set in os2.fsSelection, which means that "it is strongly recommended to use OS/2.sTypoAscender - OS/2.sTypoDescender+ OS/2.sTypoLineGap as a value for default line spacing for this font".[2] As a result, we get excessive default line spacing when using the Fira fonts as supplied, and to work around this we'll need to hack the legacy metrics - with the potential that this may lead to unwanted clipping in some environments. It would be better if Gecko respected the typographic metrics, as specified in the font itself. (The issue here was observed on b2g and reproduced on OS X; behavior on other platforms may differ, depending how our font backends calculate the line metrics. We should really try to unify more of this code.) [1] http://www.microsoft.com/typography/otspec/os2.htm#sta [2] http://www.microsoft.com/typography/otspec/os2.htm#fss
For whatever it's worth, this problem isn't even unique to Gecko; CoreText on OS X (as used by Chrome and Safari) seems to ignore the USE_TYPO_METRICS flag as well.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.