Version 4 (modified by 9 years ago) ( diff ) | ,
---|
Overview
Fonts with appropriate Unicode coverage and Open Font Format features are required for good math rendering. Maintainers of WebKit ports and operating systems should ensure that such fonts are available to get more reliable results on MathML tests and to maximize user experience. WebKit users encountering troubles with the rendering of MathML are encouraged to check that such a font is installed on their system. They are also invited to configure the default math font to match their preference.
Recommended Math Fonts
Here is a list of known math fonts that can be used to render MathML formulas in WebKit:
- Asana Math
- Cambria Math
- Latin Modern Math
- Libertinus Math
- Lucida Bright Math
- Minion Math
- STIX Math
- TeX Gyre Bonum Math
- TeX Gyre Pagella Math
- TeX Gyre Schola Math
- TeX Gyre Termes Math
- XITS Math
Latin Modern Math is recommended for users who are familiar with TeX's Computer Modern style. The STIX family provides the best unicode coverage but it has many bugs that will only be fixed in version 2. These two fonts form the recommended minimal set to consider for maintainers and the default option to try for users.
Customizing Math Font
The default font-family on the <math>
tag is not inherited but set to a list of known math fonts. Authors or readers of MathML equations can easily customize it by adding the following CSS rule to the author/user style sheet:
math { font-family: "My Fancy Math Font"; }
For best rendering, it is recommended to use text font and math font that have consistent style. For example, authors can use the following stylesheet to display their page with the "Latin Modern" style:
body { font-family: "Latin Modern Roman"; } math { font-family: "Latin Modern Math"; }
For more information, this page with Web fonts, sample CSS style sheets and online demos.
Unicode Coverage
In order to display various scientific and technical symbols, math fonts should cover the largest possible subset of Unicode Character Ranges for Scientific Documents and more specifically:
Mathematical Alphanumeric Characters are required to display variables with their default mathematical italic style and to support the mathvariant
attribute. However, the former is currently done with CSS (bug 155018) and the latter is not implemented yet (bug 108778).
Open Font Format features
Development is in progress to make our MathML support rely on TeX rules and OpenType features. Below are some features that should be provided by math fonts and implemented in WebKit:
MathConstants table
MathGlyphInfo table
MathVariants table
Tags
Nothing has been implemented yet. The following tags should be considered:
math
, ssty
, flac
, dtls
and rtlm
.