I am connecting from my Linux box to the server to run Mathematica, but the Mathematica fonts are not displayed. How do I resolve this issue?
 When trying to ssh to the remote Linux or Unix computer from your Linux machine, you may see the following error messages, indicating that Mathematica was unable to find the proper fonts: xset: bad font path element (#38), possible causes are:
Directory does not exist or has wrong permissions
Directory missing fonts.dir
Incorrect font server address or syntax
Unable to find font with family Courrier, weight Plain,
slant Plain, and size 9. Substituting fixed.
The Mathematica fonts are not properly installed in your
system. Without these fonts, typeset mathematical
expressions cannot be displayed properly
In order to resolve this issue, you will need to either install fonts on your local machine, or tell the X font server where to access them. If you are not sure if the Mathematica fonts are installed on your machine, please run the following command in a terminal window: xlsfonts | grep wri If nothing is output, then the Mathematica fonts are not installed on your machine. First, we will install the fonts to the local directory. The Mathematica fonts can be downloaded from the following links: Please unpack the fonts. Under Linux, the standard font directory is You will need to create a directory in the above the location and place the fonts here. Please note that there will be and subdirectories. In the above subdirectories, please make sure the file fonts.dir is here. If it does not exist, please create the file, as follows: mkfontdir There are three ways to make the fonts available on your machine. First, we can use the xset command. The following commands will add the corresponding directories to the font path that X server uses. xset fp+ /usr/lib/X11/fonts/Mathematica/Type1 xset fp+ /usr/lib/X11/fonts/Mathematica/BDF Please then run the following, which will cause the X server to reread font databases. xset fp rehash Please note that the xset command is executed in Mathematica start-up script. However, the script fails to find fonts in the following standard location: You can alternatively create an exact same directory structure on your local computer and place the fonts there. Even if you do not have Mathematica installed locally, they will be found and used. Here, $InstallationDirectory is the path to the directory where Mathematica is installed on the remote computer (for Mathematica version 4.2 and prior, use $TopDirectory). The default directory is: The directory structure can be created by running the following commands: mkdir -p ${InstallationDirectory}/SystemFiles/ scp -r user@remotemachine:${InstallationDirectory}/SystemFiles/Fonts/ ${InstallationDirectory}/SystemFiles/ You can also modify the configuration file of the X server. The standard file may be , or , depending on your X server. In this file, search for the section "Files" and go to the following lines. RgbPath "/usr/X11R6/lib/X11/rgb" FontPath "unix/:7100" Add one line for each of the newly created directory: RgbPath "/usr/X11R6/lib/X11/rgb" FontPath "/usr/lib/X11/fonts/Mathematica/Type1" FontPath "/usr/lib/X11/fonts/Mathematica/BDF" FontPath "unix/:7100" Please restart the X server. Note that logging out is not sufficient as you still continue to run the same X server. To restart the X server without restarting the computer, press Ctrl-Alt-Backspace. Once the X server is restarted, you may check if the fonts are available by running the following command: xlsfonts | grep wri The fonts can be made available through the local X font server. In the X server configuration file, , please check for the line below: FontPath "unix/:7100" This line tells the X server that any additional fonts, besides those listed in other directives, can be obtained from the font server. The unix keyword specifies that connection to the font server is done using the standard Unix socket, and 7100 is the standard port. Besides the standard xfs server, there are alternative servers like xfstt, xfs-xtt etc. You will need to check the documentation for the specific server you are using. For xfs, the configuration file is usually . In the xfs file, you will need to append the paths to each of the newly added font directories to the value assigned to the variable catalogue: catalogue = other_font_paths /usr/lib/X11/fonts/Mathematica/Type1 /usr/lib/X11/fonts/Mathematica/BDF Once you have added the paths to the new fonts, you need to restart the font server. This can be done by running the script that is used to start the font server with the keyword restart, as follows: /etc/rc.d/init.d/xfs restart /etc/init.d/xfs restart After the font server is restarted, the availability of fonts can be checked by running the xlsfonts command. Instead of installing fonts on your local computer, you may use the fonts available on another computer, usually the one on which Mathematica is installed. In order to do that, repeat the steps in order to make the fonts available through a font server. You will need to also make sure that the line below is commented out in the configuration file. # no-listen = tcp This will make sure that the font server will accept font requests both from its local computer, and from the network. Restart the font server on the remote computer. On your local computer, please edit the X server config file. This file can be found in one of the following locations: In the section Files, in addition to the line: FontPath "unix/:7100" Please add another line pointing to the computer running the font server: FontPath "192.121.1.1/:7100" Here 192.121.1.1 must be replaced with the actual IP address of the remote computer. The port number, 7100, in the local file must be the same as the port that the remote font server uses. Download this FAQ as a Mathematica 6.0 Notebook
Questions or comments? Send email to support@wolfram.com.
|