Open davelab6 opened 3 years ago
CSS uses the following text-based metrics as baselines for inline layout functions such as alignment, box sizing, and initial letter layout. […] cap-height Corresponds to the top of capital letters (such as “T”, “Б”, “Σ”) in Latin, Cyrillic, Greek, etc. Calculated using
sCapHeight
in OpenType. x-height Corresponds to the top of short lowercase letters (such as “m”, “л”, “α”) in Latin, Cyrillic, Greek, etc. Calculated usingsxHeight
in OpenType. https://www.w3.org/TR/css-inline-3/
In hopes of being clearer, a completely missing value in the OS/2 table is not the only possible problem. I was analytically measuring x-heights, and even allowing for the uncertainty of overshoots and stylistic interpretation, it's quite possible to detect mismatches. Highlighting one example way off the mean in this plot:
Looking at it in a font editor shows that the reported value is substantially incorrect —
So the plot isn't just showing the need for data-cleaning from the scan that produced the numbers.
That would be a great addition—projects like https://seek-oss.github.io/capsize/ which implement text cropping need these properties:
"capHeight": 700,
"ascent": 920,
"descent": -262,
"lineGap": 0,
"unitsPerEm": 1000,
"xHeight": 520,
Some Google Fonts are missing these properties
See https://twitter.com/n8willis/status/1419964016076759042?s=19 and replies