Re: [csswg-drafts] [css-values] Fallback value of ex height (#5243)

> If it is zero, Firefox, Chrome and Safari all set it to 0.8em

I'm a bit surprised by the 0.8em figure here; from what I see in the Firefox code, there are a few fallback options used on various platforms, including 0.5em (on Freetype-based platforms, Linux and Android) or 0.56*ascent (on macOS), or examining the actual ink bounds of an 'x' glyph if present. It may also use a value retrieved from OS font APIs (directwrite, core text), in which case exactly where the value comes from is opaque to us.

(A lot of this is, I think, historical baggage that could be cleaned up without too much harm.)

> used for the "ex" unit and middle alignment

Perhaps worth noting that the x-height measurement is also important as an input to [`font-size-adjust`]( computations. So  changing how it is derived from the font (or the fallback used) could affect the used font size in cases where adjustment is in effect.

(FWIW, of the various fallbacks present in different parts of the Firefox code, I suspect the 0.56*ascent value was probably the one based most directly on observation of what worked well with actual fonts.)

GitHub Notification of comment by jfkthame
Please view or discuss this issue at using your GitHub account

Received on Wednesday, 1 July 2020 10:31:35 UTC