While fAscent and fDescent of SkPaint::FontMetrics gives the ascender/descender following the platform convention, there are cases where we need sTypoAscender and sTypoDescender from 'OS/2' table.
* Computing em-height ascent/descent. The logic isn't spec'ed yet, but
what Gecko does looks reasonable.
https://github.com/whatwg/html/issues/2470#issuecomment-291425136
* Positioning underline and overline looks best served by the em-height
ascent/descent. We implemented the logic in issue 681857 (r468821)
and, unlike the previous try to use cap-height, this seems to stick.
* There seems to be needs to avoid platform-specific metrics for web
fonts. See issue 800693 and OpenType spec for stasTypoAscender:
https://www.microsoft.com/typography/otspec/os2.htm#sta
says "The goal is to free applications from Macintosh or Windows-specific
metrics".
Blink has a code to read OS/2 table directly to experiment issue 681857 , and since this sticks, it's good to move it to SkPaint::FontMetrics.
Comment 1 by kojii@chromium.org
, Jan 26 2018