22
$\begingroup$

In MathJax, users can set their math renderer to HTML-CSS, MathML and SVG. They seems affect fonts displayed. But what is the actual difference between them?

Note that fonts in pdf files are fixed, so they are invariable for different machines, i.e. are invariants of machine transformations. However fonts displayed by HTML-CSS relies on fonts used by our browser, hence are variable for machines. But are MathML and SVG also using local fonts?

$\endgroup$

1 Answer 1

14
$\begingroup$

MathML also uses local fonts. When it works, it should look nicer than HTML-CSS rendering, but support for it is spotty. Firefox supports it natively, and there's a plugin for Internet Explorer, but most common WebKit browsers -- in particular, Safari and Chrome -- have poor or no MathML support at the moment.

SVG is a graphics standard, so there should be no dependence on local fonts (but it's generally slow to render, at least in my experience).

$\endgroup$
6
  • $\begingroup$ Thank you. Btw does pdf use SVG so fonts in there are invariable? $\endgroup$
    – Popopo
    Commented Mar 26, 2013 at 3:58
  • 5
    $\begingroup$ @Popopo: that's somewhat off-topic, but the answer is no. For PDFs one (the document creating software) can choose to reference a system font or embed (a subset containing the used characters of) the font. The former case, as can be expected, does cause display problems occasionally. SVG stands for Scalable Vector Graphics, it is a graphics standard like JPEG, and has nothing inherent to do with fonts. The PDF language, being built upon a subset of PostScript, is natively capable of vector graphics, and does not "use" SVG per se. $\endgroup$ Commented Mar 26, 2013 at 9:26
  • $\begingroup$ @WillieWong I'm sorry about off-topic, I'm just a little curious. But other than that, thank you for your explanation. $\endgroup$
    – Popopo
    Commented Mar 26, 2013 at 9:45
  • 3
    $\begingroup$ Two corrections. First, MathJax's HTML-CSS will use locally installed (MathJax or STIX) fonts when available. In general, when HTML-CSS output encounters characters not in those fonts, it will ask the browser to provide fallbacks (just like any other HTML content). Second, while SVG is a graphics format, it allows embedded text elements and more generally foreign object elements (for HTML). In that case, fonts will be needed. That being said, MathJax's SVG uses SVG paths, not embedded text or html (being independent of webfonts is the point of the SVG output extension). $\endgroup$ Commented Mar 28, 2013 at 4:10
  • $\begingroup$ Does anyone know why stackexchange chooses to use HTML output instead of SVG? Curious if the decision was documented anywhere, trying to better understand the tradeoffs $\endgroup$
    – Andrew
    Commented Feb 10, 2021 at 4:16
  • $\begingroup$ That mathml is "not supported" is not true anymore. As of january 2023 chrome had full support, se caniuse.com/mathml. To verify support try eyeasme.com/Joe/MathML/MathML_browser_test.html $\endgroup$ Commented Feb 22, 2023 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .