Open litherum opened 4 years ago
https://github.com/w3c/csswg-drafts/commit/399aebf1e51d9b8915a4163060247b54a1a1d1b8 / https://lists.w3.org/Archives/Public/www-style/2010Aug/0419.html seems to be the origin of this recommendation
/cc @jfkthame
Core Text usually uses the metrics from the
hhea
table
[emphasis mine]
Are there circumstances where it uses something else? What else, and when?
Recommending sTypoAscender
/Descender
has a long history, see the 1997 Web Fonts specification:
9.11. Maximum unaccented height
For Type 1 fonts, this value may be obtained from the 'Ascender' value in the AFM file. For TrueType and OpenType fonts, this value may be obtained from the 'Ascender' entry in the 'hhea' table or (preferably) from the 'sTypoAscender' value in the 'OS/2' table. For TrueType GX fonts, the 'horizontalBefore' entry in the 'fmtx' table is used, over-riding Ascender values in the 'hhea' table. https://www.w3.org/TR/WD-font-970721#typoascent
My hazy recollection is that Windows had a broken way of measuring ascender and descender, Mac had a broken way to measure them, and sTypo*
was supposed to be the platform-neutral fix (although putting it in the OS/2 table is an odd historical curiosity)
@svgeesus Despite that being the recommendation 23 years ago, I think the ship has sailed.
@jfkthame Yes there are, but I don’t think I can get into the details - Core Text is a sophisticated, modern, production-ready text engine.
@litherum Was expecting you'd file this issue. :) The text is copied over from CSS2.
@litherum @jfkthame @svgeesus What do you think the spec should say about ascent/descent metrics? Should we just remove the note? Replace it with one talking about platform differences? Continue to suggest sTypo for anyone who's not using a platform API that has its own opinions? Something else?
It is copied over all the way from the pre-CSS Web Fonts draft.
At that time, sTypoAscender was the new shiny, and the hope was that Mac would move away from their old one and Windows would move away from their old one. (The latter did happen).
I think just removing the note is best.
I think just removing the note is best.
+1
What needs to happen in order for this to progress?
Since we're just discussing a note, can this be an editorial change?
Sure, let's just remove the note.
From https://twitter.com/nedley/status/1350145513849384961
We needed a way to opt fonts into some modern behaviors while avoiding unexpected metrics changes.
If Ned Holbrook is describing using sTypo*
on Apple platforms as modern then perhaps the recommendation should stand?
https://drafts.csswg.org/css-inline-3/#ascent-descent
WebKit on macOS and iOS uses Core Text, and Core Text usually uses the metrics from the
hhea
table. (Note,hhea
is lowercase, not uppercase.) The CSS spec should not pretend that using metrics fromhhea
is any worse than using metrics fromOS/2
.