Font Installation for Red Hat 8.0
Clemson Dell Latitude C600:
Windows 2000 and Red Hat Linux 8.0 Dual Boot

Bill Moss
October 2002

After upgrading my laptop to Red Hat 8.0 (Dual Booting the Clemson Dell Latitude C600: Windows 2000 and Red Hat Linux 8.0), I decided to look at an article I recently wrote on MathML (Mathematics in WebCT IV). Red Hat 8.0 comes with Mozilla 1.0.1 as the default browser and this browser supports MathML. However, when I viewed one of the sample documents linked to this paper, I got a warning message to install the fonts CMEX10, CMSY10, Math1, Math2, and Math 4 along with the URL: This Web page contains the following statement.

"While awaiting the comprehensive set of fonts being made by the STIX project to cover all the symbols in MathML, on the right is a list of fonts that are currently recommended for download/installation on your system if you do not have them already. You must at least install TeX's Computer Modern fonts (the TrueType versions for Windows and the Type1 versions for Linux)."

Mozilla will eventually be released with a complete set of MathML fonts and and an equation editor button on the Composer that will allow a WYSIWYG interface. For the present, it is necessary to load several fonts to view MathML documents.

Having previously installed these MathML fonts (the Computer Modern fonts and the Mathematica 4.1) on the Windows side, I decided to try it on the Linux side. What I discovered is that RH 8.0 makes this relatively easy. In particular, the X Windows system now supports TrueType fonts. This gave me the option of installing either Type 1 fonts or TrueType fonts on the Linux side and I experimented with both.

The first step in font installation is to make sure that your display is properly configured. The installation process for the C600 recognizes the video processor but treats the display as generic. You can identify it as a Dell 1024X Laptop Display Panel during installation or or you can configure the display after the installation is complete. After the installation, as root, do the following. RH -> System Settings -> Display -> -> Advanced tab -> Monitor Type -> Configure -> select the Dell 1024X Laptop Display Panel -> OK -> Set DPI -> adjust the screen size to 282 x 211 Millimeters. This screen size translates into a screen resolution of 92 x 92 dpi (dots per inch). Logout and login as root, and then issue the command xdpyinfo | grep resolution. The output should be resolution: 92x92 dots per inch.

The second step is to login to the Windows side and download the Mathematica 4.1 TrueType fonts for Windows from Execute this self-extracting archive and then zip the resulting folder. While you're at it, copy the Arial, Times New Roman, and Courier New fonts in C:\winnt\fonts to another folder and then zip that folder. Reboot to Linux and login as root. I'll assume that you have configured Linux to mount your windows partitions as discussed in Dual Booting the Clemson Dell Latitude C600: Windows 2000 and Red Hat Linux 8.0. Copy the zip files to the Linux side and unzip. Also download, the TeX Type 1 fonts from the above Web site and extract this archive. The resulting directory cmpsfont contains the subdirectory pfb. Rename this directory cm. Let's assume that we now have three directories, MathFonts_TrueType, TTFonts, and cm, containing Mathematica 4.1 TrueType fonts, Windows 2000 TrueType fonts, and TeX Type 1 fonts, respectively. Copy these font directories to /usr/share/fonts.

The third step is to prepare the files fonts.dir and fonts.scale which are needed by the X Windows system. Many font directories are distributed with these files included. Here is the procedure for creating these files. To create a fonts.scale file, cd into the directory and issue the command

ttmkfdir -o fonts.scale for a directory of TrueType fonts
mkfontscale for a directory of Type 1 fonts.

Create the fonts.dir file using


The fonts.scale file created using the mkfontscale command for the Tex Type 1 fonts did not work correctly. After a web search, I was able to download a fonts.dir that worked and have included it here.

The fourth step is to make these new font directories available to the X Windows system by using the commands

chkfontpath -a /usr/share/fonts/MathFonts_TrueType
chkfontpath -a /usr/share/fonts/TTFonts
chkfontpath -a /usr/share/fonts/cm
xset fp rehash

All these commands are part of the Red Hat 8.0 distribution.

Mozilla Configuration

To make Mozilla on the Windows side look like Mozilla on the Linux side, under Windows and Linux, start Mozilla and do Edit -> Preferences -> Appearance -> Fonts -> Proportional: Size (pixels) 18 ->Serif: New Times Roman -> Sans-serif: Arial -> Monospace: Courier New, Size (pixels) 12 -> Minimum font size: 9 -> Display resolution -> Other -> Enter the length of the line as 3.25 inches (92 dpi). Under Windows, set the Internet Explorer Text Size by selecting View -> Text Size -> smaller.

On the Linux side, create the file userChrome.css in the directory /root/.mozilla/default/random_number.slt/chrome containing the following lines.

window, menubar, menubutton, menulist, menu, menuitem {
font-family: arial !important;
font-size: 11pt !important;

When you login as a regular user, you will have to add a similar userChrome.css file to your Mozilla profile.

Edit the configuration file /usr/lib/mozilla-1.0.1/defaults/pref/unix.js as follows.

// TrueType
pref("font.FreeType2.enable", true);
pref("font.freetype2.shared-library", "");
// if libfreetype was built without hinting compiled in
// it is best to leave hinting off
pref("font.FreeType2.autohinted", true);
pref("font.FreeType2.unhinted", false);
// below a certian pixel size anti-aliased fonts produce poor results
pref("font.antialias.min",        10);
pref("font.embedded_bitmaps.max", 1000000);
pref("font.scale.tt_bitmap.dark_text.min", 64);
pref("font.scale.tt_bitmap.dark_text.gain", "0.8");
// sample prefs for TrueType font dirs
pref("", "/usr/X11R6/lib/X11/fonts/TTF");
pref("", "/usr/share/fonts/TTFonts");

Gnome Desktop Configuration

You can also experimented with TrueType fonts on the GNOME desktop. Try RH -> Preferences -> Font -> Application font: Arial -> Desktop font: Arial -> Windows title font: Arial -> Details -> Resolution (dots per inch) 92.

OpenOffice Configuration

All the fonts that have been added to the X Windows systems are now available to OpenOffice. After comparing a number of fonts, I set the default to Century Schoolbook L, 12 pt. Times New Roman also look good as well.

Maple 8 Configuration

Maple 8 on Unix by default uses Times 12 pt for the Normal (text input) style and Courier 12 pt for the Maple input style. In the configuration file /usr/local/maple8/X11_defaults/Maple8, Maple can be set to use TrueType fonts but there is a warning that this may slow down Maple computations. I edited theMaple8 file to use TrueType fonts and then edited the default styles (format -> styles). I increased all the points sizes by 2 and changed the fonts from Times, Courier to Times New Roman, Courier New. These are the default fonts used on Windows and Mac. I hit the Save as Default button and saved the new defaults in /usr/local/maple8/stylesheet.mws. Any new worksheet that is created will use these new defaults. If a legacy worksheet is opened, the new defaults can be activated by doing format -> styles -> Revert to Default. I executed a couple of computationally intensive worksheets without noticing a slowdown.

Web Cascading Stylesheets

I use a cascading style sheet to maintain a uniformity of style across a number of articles published on the web. This stylesheet contains the following lines.

.paragraph { font-family: sans-serif; font-size: small}
.section { font-family: sans-serif; font-size: x-large; font-weight: bold}
.subsection { font-family: sans-serif; font-size: large; font-weight: bold}
.courier { font-family: "Courier New", Courier; font-size: small}
.navigation { font-family: sans-serif; font-size: x-small; text-decoration: none}
.nav_head { font-family: sans-serif; font-size: small; font-weight: bold; text-decoration: none
.paragraph_large { font-family: sans-serif; font-size: medium
.courier-small { font-family: "Courier New", Courier; font-size: x-small}
.content { font-family: sans-serif; font-size: medium; color: #0000FF}
.title { font-family: sans-serif; font-size: xx-large; font-style: italic; font-weight:  bold; color: #990000}
.author { font-family: sans-serif; font-size: medium}

It is a challenge to get these articles to display with consistent font sizes across three browsers -- Internet Explorer and Mozilla under Windows and Mozilla under Linux, because these browsers uses different font scaling increments. With the above browser settings, I did obtain reasonably consistent font sizes when viewing these articles. I finally decided to reset my fonts on Mozilla under Linux by doing Edit -> Preferences -> Appearance -> Fonts -> Serif: adobe-times -> Sans-serif: adobe-helvetica -> Monospace: adobe-courier but it was a close call.