Fonts on Linux

Dealing with fonts under Linux can sometimes be tricky. The important issues in dealing with fonts in the Wolfram System are presented in this tutorial for your convenience.

Font Formats

The Wolfram System front end supports BDF, TrueType, and Type1 fonts. These fonts are automatically installed by MathInstaller during installation.

Font Installation

All machines that display the front end must have access to the fonts included with the Wolfram System. If the Wolfram System process is running on a remote machine and the front end is displayed on the local machine, the X server on the local machine must know where to find the Wolfram System fonts. To do this, add the Wolfram System fonts to the local font path by running a command like the following on the local machine.

xset fp+ /usr/local/Wolfram/Mathematica/11.2/SystemFiles/Fonts/Type1; xset fp rehash

Be sure to execute xset fp rehash to make the fonts available to the local X server.

For optimal onscreen performance, Type1 fonts should appear before BDF fonts in the font path. Hence, $InstallationDirectory/SystemFiles/Fonts/Type1 should appear before $InstallationDirectory/SystemFiles/Fonts/BDF. You can check the order of the font path by executing the command xset q.

Note: TrueType fonts are automatically loaded and do not require an xset command.

Font Servers

You may prefer not to install local copies of the Wolfram System fonts on all machines. You can instead set up a font server with all the necessary Wolfram System fonts. The other machines on the network can then find the fonts as needed by reading them from the Wolfram System directory on the font server. Consult your operating system's documentation for further information.

Common Font Errors

On some systems, the font path is limited in length, and it is possible to receive xset: bad font path element errors even if the fonts are available to the server. In this case, try reordering the font path and adding the directories for the Wolfram System fonts earlier in the path. The directory $InstallationDirectory/SystemFiles/Fonts/Type1 must be listed before $InstallationDirectory/SystemFiles/Fonts/BDF on the font path for optimal onscreen performance.

Fonts and Printing

When the X front end prints a notebook, it uses AFM files for the font metrics needed for printing. If you want to print using a particular font not included with the Wolfram System, you will need the AFM files for the font. These files are installed in either $InstallationDirectory/Configuration/Fonts/AFM, /usr/lib/AFM, or /usr/lib/afm. Fonts are normally downloaded to the printer by the front end when printing. You may be able to download the fonts and store them on the printer. See the documentation and programs that came with your printer for more information.

Related Tutorials