Linux XFT and MathMLFrom MozillaZine Knowledge BaseIn 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.
[edit] 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. [edit] 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. [edit] Installing the fontsBoth sets of fonts are distributed in compressed form:
[edit] Distribution specific methods for installing the fonts
[edit] A generic way of installing fontsThese instructions are based on the installing fonts under Linux document at linux.org.mt. You will probably need root access to follow these instructions.
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.
[edit] Installing the Symbol fontBy 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".
[edit] 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 [edit] Getting freetype working with non-Xft buildsIf 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.
font.FreeType2.enable=true
[edit] Advanced TopicsThere are various ways to get nicer fonts or enable more fonts. Hopefully someone who knows them will add them here. [edit] Testing MathML fontsThe MathML torture page is a good place to start testing fonts [edit] Further InformationThe MathML project page has more information about all aspects of MathML in Mozilla. |
|