Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intent to prototype: Default font metrics overriding

67 views
Skip to first unread message

Jonathan Kew

unread,
Mar 22, 2021, 6:31:46 AM3/22/21
to dev-pl...@lists.mozilla.org
Summary: For historical/legacy reasons, fonts may contain multiple,
conflicting versions of key metrics such as line ascent and descent, and
user agents/platforms may rely on different fields in the font. This
results in inconsistencies in line spacing, baseline alignment, etc.

To enable authors to achieve more consistent layout, the CSS WG has
added descriptors to the @font-face rule that override whatever value
the browser would use from the font resource, and provide an explicit
author-provided value instead.

This can be used to harmonize line spacing behavior across browsers and
platforms, or across different fonts where the designers may have made
incompatible choices regarding the line metrics.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1681691

Standard: https://www.w3.org/TR/css-fonts-4/#font-metrics-override-desc

Platform coverage: All

Preference: layout.css.font-metrics-overrides.enabled

DevTools bug: None needed. (More generally, it would be awesome to have
a @font-face rule inspector in DevTools -- distinct from the existing
font *properties* inspector; such an inspector would expose this along
with the other @font-face descriptors. But that's not specific to these
new descriptors.)

Other browsers: Already shipping in Chrome.

web-platform-tests: There are a few tests in /css/css-fonts/, which will
pass in Firefox once this is implemented.
0 new messages