Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Fonts for Mozilla 1.8's MathML engine

Note: These instructions are for Mozilla 1.8. You may want to read the most recent documentation instead.
Fonts to Install for Mozilla 1.8
Test Drive
The aim is to only see a minimum number of '?' as possible in this list of characters/entities for scientific documents. The list is best viewed with a Unicode-based browser such as Mozilla (a MathML-enabled build gives access to more glyphs via the ucvmath module).

Mozilla 1.8 (including Firefox 2.0) was developed before any STIX fonts were publicly available. It was developed for use with Mathematica and/or Computer Modern fonts. Users may still benefit from installing the STIX fonts, but will still need to install Mathematica fonts and/or possibly BakoMa Computer Modern fonts.

Use the font installers (on the right) to install the fonts on your system if you do not have them already. MIT has developed convenient font installers for Windows and the Mac, following licensing negotiations through this project and mozilla.org staff (especially considering the open-source nature of Mozilla). The respective font owners have made provision for the fonts to be packaged into these installers, with the aim of helping to boost the adoption of MathML into the mainstream.

For your information, recommended fonts include:

  • TeX's Computer Modern Fonts
    The TrueType fonts of interest are provided by virtue of the BakoMa license. The Type1 versions are from AMS. Note that TeX fonts are not bundled in the Mac installer due to bug 161137. You must not install these TeX fonts on the Mac now. To stop Mozilla from popping up the missing font dialog about TeX fonts, just set the user preference "font.mathfont-family" to "Math1, Math2, Math4, Symbol" in about:config or prefs.js.

  • Mathematica 4.1 Fonts
    The TrueType font packs are provided by Wolfram Research, Inc., for Windows and the Mac. The Type1 versions are in the PFA and PCF formats.

  • Other Fonts
    • MT Extra -- this is only in the Windows installer.
    • Lucida Sans Unicode -- this is not in the installers but it is worth installing (separately) if you can. It contains many useful mathematical symbols. For Windows users, the installation of new fonts is explained in this font installation procedure.

Known Problems

Reported fonts' problems for which no built-in error recovery mechanism exists in Mozilla 1.8.

  • On the Mac, bug 161137 causes MathML to render wrong symbols if TeX fonts are installed.
  • On Win9x/NT/2000: If you see symbols (like the square-root symbol) that appear jagged, then you are not using TeX fonts from the Bakoma collection.
    Work-around: Download the fonts from the Bakoma collection given above.

Customize the fonts used for stretchy characters

Due to the fact that a browser is used by various users under different configurations, Mozilla's MathML engine doesn't make assumptions on the particular configuration that a viewer may have, and uses a greedy search when looking for the best glyph that fits in a certain situation. As a result, a document is sometimes displayed with a mixture of glyphs with different characteristics because these glyphs happen to be picked from different font families.

It is possible for you, as a viewer, to instruct the MathML engine to only use some of the fonts that you prefer. The following description applies to fonts that only affect stretchy characters. Other characters will continue to be rendered with other fonts (these are also configurable -- but their configuration is not described here). You will have to edit prefs.js in your profile directory (tip: you can also edit your preferences by entering about:config in the address bar).

To illustrate the impact of the choice of fonts, here are screenshots of a same page rendered with different stretchy font settings. These will give you a precise idea why it is academical/subjective, but still itchy enough for some people to insist on one or the other, just like one person might prefer Times while another prefers Verdana. The screenshots use an excerpt from the GNU Scientific Library manpage(c.f. bug 118475):

  1. Default screenshot: this is the default rendering obtained with the default installation.
  2. Mathematica screenshot: this is the rendering obtained by instructing the MathML engine to use Mathematica fonts when a character is being stretched. This can be achieved by adding this line in your prefs.js:
    user_pref("font.mathfont-family", "Math1, Math2, Math4, Symbol");
  3. TeX screenshot: this is the rendering obtained by instructing the MathML engine to use TeX's Computer Modern fonts when a character is being stretched. This can be achieved by adding this line in your prefs.js:
    user_pref("font.mathfont-family", "CMSY10, CMEX10, Symbol");

As a web viewer reading pages produced by others, it is possible for you to set the list differently from the examples above. In fact, it is possible to specify fonts per each individual stretchy character (in the mathfont.properties file which contains some of the encoding data of MathML characters).

The recommended rule of thumb is to install all the fonts (if possible) but use the above screenshots to decide whether you prefer stretchy characters to be rendered by TeX fonts or Mathematica fonts, then set the font.mathfont-family accordingly. The reasoning here is that some of these fonts also contain normal (i.e., non stretchy characters) and you don't want to lose them, if possible. Both TeX fonts and Mathematica fonts work fine on Windows and Linux. As indicated above, TeX fonts cause troubles on the Mac and so Mathematica fonts are preferred there even for normal characters (see also bug 228804 comment 32).

As a web author producing pages to be read by others, it is also possible for you to instruct their MathML engine to only use some of the fonts that you prefer for your documents (see the documentation in mathml.css, and how this is used to setup the alternate stylesheets that appear in the demos of MathML tags). The caveat to remember:

  • if a viewer has set the pref above, the fonts selected from your list are checked against the list that the viewer has chosen.
  • viewers can choose to override document fonts altogether (by visiting the Fonts pref dialog and unchecking the pref to allow document fonts in the usual way).

Roger B. Sidje and Karl Tomlinson

Document Tags and Contributors

 Contributors to this page: fred.wang, fscholz
 Last updated by: fred.wang,