Serving Fonts to Many Computers

You can configure X to use a font server, which is a program that delivers bitmapped fonts to any X server on a network. The font server may deliver a bitmap font directly or it may create a bitmap from an outline font file. In fact, Mandrake and Red Hat both use font servers rather than X's built-in font rendering mechanisms. These distributions run a font server and tell X to use the font server running on the same computer. This practice arose when font servers to handle TrueType fonts became commonplace, but before TrueType support was integrated into X. If you must use a pre-4.0 version of XFree86, this remains the simplest way to use TrueType fonts, at least from applications that can't use Xft, as described in the next section, "Using Font Smoothing." To tell X to use a font server, you pass the name of the font server to X via a FontPath line in XF86Config's Files section:

FontPath "unix/:7100"

FontPath "tcp/"

The first of these two lines is the default configuration in Red Hat. It tells Linux to look at port 7100 on the local computer for a font server. Mandrake's configuration is similar, except that it uses -1 instead of 7100. The second line is not the default for any major Linux distribution. It tells the computer to look for a font server on another computer—port 7100 on the computer in this example. One computer can include several font servers in its font path.

Using a networked font server has certain advantages. Most importantly, it can simplify font configuration on a large network. Rather than install the same fonts on many computers, you can install them on one system and configure all the X servers on a network to use fonts from the font server computer. Unfortunately, this approach also has its disadvantages. One problem is that applications can misbehave or hang if the font server becomes inaccessible or is restarted. Another problem is that networked font servers don't work well with applications that do font smoothing. Such applications are becoming more common, so relying on a font server for important fonts is becoming increasingly undesirable. Note that these problems aren't as important for local font servers, as used by Mandrake and Red Hat. Network problems are unlikely to make their font servers inaccessible, and local programs can still find locally installed fonts for font smoothing, even if they're also delivered via a font server.

Whether you run a font server locally or in a network-accessible manner, you must configure it. The most common font server for Linux is xfs, which ships with X. This server is usually configured through the /etc/X11/fs/config file. You set the font path in this file through the catalogue line, which lists font directories separated by commas on one or more lines, as in:

catalogue = /usr/X11 R6/lib/X11/fonts/URW, /usr/local/fonts/tt

If you're setting up a font server on a distribution that doesn't normally run one, you must launch the font server by creating a new startup script, as described in Chapter 9, "Bypassing Automatic Configurations to Gain Control;" or you may find a SysV startup script for the font server that's currently inactive and be able to activate it.

If your distribution uses a font server by default and you want to open it up for other systems to use, you should check for a couple of lines in the /etc/X11/fs/config file:

Either option makes the font server inaccessible to other systems. If you find the first, you should comment out the line. If you find the second option, change -1 to 7100 and alter the FontPath entry in XF86Config appropriately. Mandrake overrides the port number in its xfs SysV startup script, /etc/rc.d/init.d/xfs. Therefore, you must also change the references to -port -1 in this file to-port 7100. After making these changes, you must restart the font server. If you changed the XF86Config file, you must also restart X, or at least use xset to reset X's font path to reflect your changes.

In order to serve fonts, xfs requires that font directories be prepared just as they are for an X server. Therefore, you should consult the earlier section, "Setting Up a Font Directory," for information on this task.

Note Versions of xfs delivered with XFree86 3.x and earlier don't understand TrueType fonts. If you're using an older Linux distribution and want to serve TrueType fonts, you can use a version of xfs from a more recent distribution, or you can use a TrueType-enabled font server, such as xfsft ( orxfstt ( If you're using a recent distribution that ships with XFree86 4.x but you must still use XFree86 3.x for your video card, you can use the xfs that ships with your distribution in order to use TrueType fonts.

0 0

Post a comment