The "math" generic font family
- Category
- CSS
- Type
- Chromium catches up
- Status
- No active development (Chrome No active development)
- Intent stage
- Dev trials
WPT details: MathML one: mathml/relations/css-styling/default-font-family.html https://w3c-test.org/css/cssom/font-family-serialization-001.html https://w3c-test.org/css/css-fonts/generic-family-keywords-001.html https://w3c-test.org/css/css-fonts/generic-family-keywords-002.html Probably need to write some for the css-specific part.
Summary
This generic font family allows authors to style content with a mathematical font. Main use case is MathML, since this would be the default font-family on <math> tags.
Motivation
- allow users to select a preference math fonts - allow authors to style content with a math fonts that has special features for rendering mathematical expressions (stretchy operators, math glyphs, etc) - render MathML content with a special math font instead of the one inherited from the parent.
Standards & signals
- Specification: https://drafts.csswg.org/css-fonts/#font-family-prop
- Firefox: Positive — Firefox has a user preference for the math font used for MathML. However, it's currently implemented via a fake "math" lang. I sent a request for position to see if using font-family: math instead would work better.
- Safari: No signal — WebKit hardcodes a list of math fonts in the UA sheet. I sent a request for position to see if using font-family: math instead would work better.
- Web developers: Positive — Default math font is something that has historically been important for Firefox/WebKit users. This is something that was raised in the new MathML WG and had already been introduced in the CSS spec before, so there seem to be some interest.
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=6606
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=mathml%2Frelations%2Fcss-styling%2Fdefault-font-family
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+The%20%22math%22%20generic%20font%20family
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=The%20%22math%22%20generic%20font%20family
- Baseline status: https://webstatus.dev/?q=The%20%22math%22%20generic%20font%20family
Explainers: https://people.igalia.com/fwang/explainer-font-family-math/