Linux XFT and MathML
From MozillaZine Knowledge Base
In order to view MathML content, you must have the appropriate fonts installed. On Linux systems, the fonts come in two formats; type1 for a non-XFT build (default for Mozilla Suite) and Truetype for an XFT build (default for Firefox, Thunderbird and RPM packaged Mozilla Suite builds. This page concentrates specifically on the XFT enabled case.
How do I tell if I have an XFT enabled build?
In the address bar of your browser, type about:buildconfig This produces a list of the options used when building the browser. If the list of options includes the string --enable-xft then you have an XFT enabled build.
Which fonts do I need?
Assuming you have a MathML enabled build, you need Truetype format font files. There are two sets of files that you need:
You may also require a symbol font, although this does not have to be a Truetype font - see the section on installing an symbol font later in the article.
Installing the fonts
Both sets of fonts are distributed in compressed form:
Distribution specific methods for installing the fonts
A generic way of installing fonts
ttmkfontdir > fonts.scale mkfontdir
This should create a file fonts.scale and fonts.dir
chkfontpath -a /usr/local/fonts/tex
where /usr/local/fonts/tex should be replaced by the directory in which you placed the fonts. If this command does not exist, you will need to edit the X font configuraion file directly. Typically, this will be loacted somewhere like /usr/etc/X11/fs/config or /etc/X11/xfs/config. Look for a line starting with 'catalog=' and append the name of the directory you installed the fonts to onto this line.
Installing the Symbol font
By default, Mozilla is able to make use of a Symbol font in type1 format, because these are more widely available. However, the default name of the symbol font that comes with most Linux distributions is not recognised by Mozilla.
One way to obtain a symbol font is to change the name of an installed symbol font so it is recognised by Mozilla. You will need to locate a symbol font on your system (more detail would be good here). Open the fonts.spec file in the directory containing the symbol font and find lines containing "Standard Symbols L"; duplicate these lines, replacing the string "Standard Symbols L" with "Symbol".
Using a Truetype Symbol font
#encoding.symbol.ttf = Adobe-Symbol-Encoding #encoding.symbol.ftcmap = mac_roman
i.e. replace them with:
encoding.symbol.ttf = Adobe-Symbol-Encoding encoding.symbol.ftcmap = mac_roman
Getting freetype working with non-Xft builds
If your build does not have --enable-xft, it is possible that it still has the TrueType support compiled in. This support is different from that with --enable-xft builds. It is generally agreed that --enable-xft builds produce better looking results.
There are various ways to get nicer fonts or enable more fonts. Hopefully someone who knows them will add them here.
Testing MathML fonts
The MathML torture page is a good place to start testing fonts
The MathML project page has more information about all aspects of MathML in Mozilla.