In the stylesheet for my website I have
.mi, .mo {
font-family: 'Charter', 'MathJax_Math' !important;
}
Setting aside for the moment whether this will always produce satisfactory results for users when an ideal version of Charter is present (so far it does for me), is there a way to ensure that this will have the same effect on machines that I can't test it on. Clearly this fails gracefully for users that lack Charter entirely, but what I wonder is whether the there are Charters in wide use that lack the features that make my version work.
Are there versions of Charter that are better or worse for rendering MathJax? If so how can a locate and test them, or perhaps exclude versions that are less capable?
Note this is not a question about downloading Charter along with the pages. If a user doesn't have Charter, he probably isn't attached to it and will be fine with MathJax's default font. What I want to be sure of is that a user who has Charter gets MathJax as Charter, but that users with "poor" Charters (if they exist) aren't punished.
No Charter-like font is currently supported by MathJax.
MathJax only supports a limited number of fonts, no matter if webfont or locally installed; see the docs (under availableFonts
and webFont
)
While you can override fonts using !important
, this will lead to poor typesetting quality. Due to browser limitations, MathJax can not access the relevant metrics of the font to correctly calculate its layout. For a supported font, MathJax will load pre-compiled font data dynamically.
Of course you can add support for Charter to MathJax using the MathJax development tools, but IIRC Charter does not contain many mathematical characters -- so rendering quality will be poor again.
Finally, if you only need text boxes within mathematical content to use Charter, that is actually supported. Just configure MathJax to use the surrounding font for text boxes by setting mtextFontInherit = true
.
You cannot ensure that an “ideal” version of Charte is used (for whatever definition for “ideal” you are using), since by saying font-family: 'Charter'
, you are just asking the browser to use a font named “Charter”. It could be a font of any design. CSS has no tools for querying the properties of a font even in a technical sense, still less in design sense.
In practice, they seem to be several versions of Charter around (at least a free font and a more extensive, and somewhat different, commercial font at myfonts.com.