Fontmetrics testcase

Each cell in the tables below has a different version of the Ahem font with slightly different metrics. Different results will be seen in Chrome, Firefox, Webkit and on Windows, macOS and Linux. Summary of the algorithm is at https://github.com/w3c/csswg-drafts/issues/2228#issuecomment-631657902.

Orange shows the line-height, green (an inline) shows the nominal position of the text, yellow is the the actual glyph. Unless otherwise stated, all ascent/descent properties are 800/-200, and all linegap properties are 1.

Table 1: which metrics are used?

Each column has had a different set of metrics "damaged" (set to 500/-500 rather than 800/-200), to make it easy to see which metrics are being used for layout. The fonts in the bottom row have bit 7 of os2.fsSelector ("use_typo_metrics") set.

hhea.ascent os2.sTypoAscent os2.usWinAscenider
use_typo_metrics = 0
A
A
A
use_typo_metrics = 1
A
A
A

Table 2: which linegap is used?

Each row shows whether the fonts in that row have bit 7 of os2.fsSelector set, and which linegap property has been adjusted (the linegap property not listed remains set to 1). Each column shows the value the adjusted linegap property was set to.

0 200 400
use_typo_metrics = 0 hhea.linegap
A
A
A
os2.sTypoLineGap
A
A
A
use_typo_metrics = 1 hhea.linegap
A
A
A
os2.sTypoLineGap
A
A
A