Mozilla Matters

In the past, Mozilla is released with it's user interface (UI) built with Gtk1 libraries. Thus, whatever settings you have for displaying Gnome 1.x applications will affect how Mozilla looks: colors, fonts, etc. If you do not select a Gtk1 theme or "look" you will end up with the default, which isn't that bad. This is generally true of any version of Mozilla you download from Mozilla, and with Netscape 6 & 7.

This can be pretty nice to work with if you have a good display of TrueType and Type1 fonts set up (see "Font Fight" for details). With the upgrade in your Freetype2 libraries, you can get good, sharp, readable display.

Too often, though, Anti-aliasing is turned on by default, and this really works poorly with Gtk1. The fonts look rather fat, the colors too stark, and the edges are not clean. The solution is widely available on the Internet, and I've summarized it here:

If you intend to change the settings for all users on the machine, find the file "unix.js". It's often in /opt/mozilla/defaults/pref/. If you installed a version downloaded from Mozilla or one of their mirrors, packaged as a ".tar.gz" file, it's installed by default in /usr/local/mozilla/defaults/pref/. Make a backup copy:

   cp unix.js unix.bak

Then open unix.js in your favorite editor and go down to about line 195 which starts the following section. What you see here turns on Anti-aliasing:

// TrueType
pref("font.FreeType2.enable", true);
pref("font.freetype2.shared-library", "libfreetype.so.6");
// 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);

You'll notice all but one of the lines starting with pref end with the words "true" or "false" -- simply reverse each one so that it looks like this:

// TrueType
pref("font.FreeType2.enable", false);
pref("font.freetype2.shared-library", "libfreetype.so.6");
// if libfreetype was built without hinting compiled in
// it is best to leave hinting off
pref("font.FreeType2.autohinted", false);
pref("font.FreeType2.unhinted", true);

If you intend only to change your own personal settings, paste a copy of the second version above in a file named "user.js" and place it in your mozilla directory. Mine looks like this:

/home/jeh/.mozilla/jeh/[random sequence]/

One other hint: in the same directory, you will see a subdirectory called "chrome" -- if you make a file named "userChrome.css" and put the following lines in it:

* { font-family: arial !important;
    font-size: 12pt !important;
}

you'll get Arial font size 12 displayed in all the menus. By observing the format, you should be able to discern how to get any other font and size to suit your tastes.

However, with the versions of Mozilla that come bundled with some recent releases of Linux, the UI is built on Gkt2. This is a whole different game. The UI will reflect your settings for Gnome 2 applications, and this requires more than just selecting a theme while running Gnome 2. It requires editing at least one file in your home directory. See Gtk 2 Issues on how to set the font size to one that's readable.

These recent Gtk2 versions of Mozilla are becoming the standard, as everyone is moving away from Gtk1. Anti-aliasing is turned on by default on these, too, and is much harder to turn off. However, the one thing Gtk2 does right is Anti-aliasing. Frankly, it's superior to that produced under KDE and the Qt interface. I can't imagine any reason to turn it off, nor can I find a reliable method to do so.


Ed Hurst, 01 January 2004
This document released into the Public Domain.