Skip to content

Improvement to math font selection

Created by: fred-wang

cc'ing @physikerwelt

From http://www.mathml-association.org/MathMLinHTML5/output/S2.html#SS3.SSS2:

"Because mathematical formulas are generally written with special fonts, the default user agent stylesheet must reset the CSS font-family on the math element to serif. User agents should then use their own mechanism to try and interpret this serif value on the math element as a font with an OpenType MATH table."

  1. This is maybe too specific to Gecko's implementation. The note should probably just suggest to make the user agent stylesheet change the font-family in order to force the selection of a math font.

  2. To solve size inconsistency between the text font and math font, maybe introduce a new CSS keyword for font-size ("auto-adjust", "match-parent" or something like that) that would tell the CSS engines to automatically adjust the font-size of an element to take into account font-family change, so that the text height remains the same. See https://phabricator.wikimedia.org/T132607