Fighting Font Frustration
X Font Scaling

By Steve Coile

As a heavy user of Netscape Navigator under Red Hat Linux, I find myself frequently frustrated with the problems experienced visiting overly-fancy Web page designs and Web pages designed only for Microsoft Windows users related, often because of problems rendering fonts. Unfortunately, these problems occur frequently. On the up-side, I've managed to find ways to alleviate them to an acceptable level. This article discusses several steps that can be taken to improve the Web browsing experience using Netscape Navaigator and Communicator under Red Hat Linux. Much of this material may also be applied to other variants of Linux and UNIX.

In part one of this article, I discussed the basic steps that users of Netscape Navigator and Communicator for Red Hat Linux and other UNIX and Linux variants can take to improve the browsing experience. Here I discuss steps for more advanced Red Hat Linux users and systems administrators. All of the steps discussed in part two require root access.

Much of the material presented here is derived from the XFree86 Font Deuglification Mini HOWTO by Doug Holland.

Up with Font Resolution

Most monitors today are capable of a display resolution of 100 dots-per-inch (DPI) or better. Red Hat Linux 6.2 includes fonts sized specifically designed for these higher-resolution monitors, but is not configured to use these fonts by default. Increasing the resolution results in crisper font display.

100 DPI fonts are not installed by default with Red Hat Linux 6.2. In order to use the 100 DPI fonts included with Red Hat Linux, you must install the XFree86-100dpi-fonts package, included on the installation media and available via anonymous FTP from ftp.redhat.com.

After installing the 100 DPI font package, the X windowing system must be instructed to operate in 100 DPI mode. To do, so, modify /etc/X11/xdm/Xservers by adding the "-dpi 100" option to the command line that starts the X server. For instance, change the line:

so that it instead reads:

The font server (the server software that makes shared fonts available to application software) shipped with Red Hat Linux is configured to provide 75 DPI fonts by default. To change this, modify /etc/X11/fs/config by changing the value associated with the "default-resolutions" directive so that it reads "100,100,75,75". For instance, change the line:

so that it instead reads:

By placing the 100s before the 75s, we've instructed the font server to provide 100 DPI fonts in favor of 75 DPI fonts when fonts for both resolutions exist.

I tend to prefer smaller fonts over larger ones as smaller fonts allow for more text to be displayed in the same space. Some applications do not specify a font size when requesting fonts from the font server. In such cases, the font server will provide a font in the default font size, which is specified by the "default-point-size" directive. The default default font size is 12 point, expressed as 120 decipoints. I prefer a default size of 10 points, so I changed the line:

so that it instead reads:

You can choose a larger default font size by increasing the number instead of decreasing it.

The changes to the font server will take effect the next time the font server is restarted or when the system is next rebooted, whichever comes first. Changes to the X window system will take effect when the windowing system is next restarted (such as when you logout using the GUI interface) or when the system is next rebooted.

Down with Font Scaling

As discussed in part one, font scaling is the process of resizing a fixed-size font. An unfortunate side-effect of scaling is pixelation. Pixelation within Netscape can be mostly avoided by instructing Netscape to avoid font scaling. My experience, however, is that doing so is not sufficient to avoid pixelation completely: the default configuration of the font server shipped with Red Hat Linux will scale fonts itself is a requested font size is not available natively. To avoid any unsightly results of font scaling, this feature must be disabled.

To disable font scaling by the font server, review the file, /etc/X11/fs/config, and locate the "catalogue" specification. This directive identifies the directories containing fonts to be served by the font server. The listing typically includes lines ending with the suffix, ":unscaled". An example of the "catalogue" directive is below.

Note that for each line ending in ":unscaled", there is a similar line without the suffix. (e.g. /usr/X11R6/lib/X11/fonts/75dpi:unscaled and /usr/X11R6/lib/X11/fonts/75dpi). These lines are highlighted in the example above.

To prevent server-side font scaling, remove the line without the suffix corresponding to the ones with the suffix, leaving only the suffixed lines. The following shows how the directive would appear after this change is made:

These changes will take effect the next time the font server is restarted or when the system is rebooted, whichever comes first.

Making it Happen

In order to make the changes described above, the font server and the windowing system need to be restarted. The easiest way to do this is to reboot the system. If rebooting the system is not desirable, the following steps can be taken to put the changes into effect:

  1. Restart the font server. To do so, issue the following commands:
  2. Restart the X windowing system. If you are currently logged in through the GUI, logout. The X windowing system will restart automatically. If you are not logged in, simply press Ctrl-Alt-Backspace. The screen should flicker once while X restarts.

More to Come...

As you continue to wander the Web, you'll notice that the suggestions I've given here have alleviated some problems, but not nearly all of them. Part one of this article described steps all users can take to reconfigure Netscape for a better browsing experience. Part three describes steps the more advanced user can take to make the system compatible with Microsoft font specifications.


Copyright 2000 by Red Hat, Inc. and Steve Coile.