[css-text] [css-values] Circular dependency between letter-spacing and x-height · Issue #5498 · w3c/csswg-drafts (original) (raw)

https://drafts.csswg.org/css-text-3/#letter-spacing-property

When the effective spacing between two characters is not zero (due to either justification or a non-zero value of letter-spacing), user agents should not apply optional ligatures

letter-spacing takes a <length>, which means that it accepts font-relative units, like 2ex for example. Some (all?) browsers can measure the ex length by actually rendering a literal "x" character and inspecting its height (at least in the case where the metrics inside the font appear to be bogus). However, the liga font feature can change which glyph the "x" character renders with, so if we're supposed to not apply optional ligatures, the height of the "x" character can change depending on whether we're disabling ligatures or not. This means that, if someone applies letter-spacing on an element with ex units, we may have to measure a glyph, but in order to know which glyph to measure, we have to know whether that glyph has a height of 0 or not.

It's a weird fiddly corner case that probably wouldn't ever make a difference in real content, but it's probably worth at least considering how to fix it.