fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
548 stars 99 forks source link

Check Proposal: os2 metadata set #3391

Open davelab6 opened 3 years ago

davelab6 commented 3 years ago

See https://twitter.com/n8willis/status/1419964016076759042?s=19 and replies

thlinard commented 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 using sxHeight in OpenType. https://www.w3.org/TR/css-inline-3/

n8willis commented 3 years ago

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: xheight-courgette

Looking at it in a font editor shows that the reported value is substantially incorrect — fontforge-courgette

So the plot isn't just showing the need for data-cleaning from the scan that produced the numbers.

jlarmstrongiv commented 2 months ago

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