Fonts

Community Enterprise Linux uses two subsystems to manage and display fonts under X: Fontconfig and xfs.

The newer Fontconfig font subsystem simplifies font management and provides advanced display features, such as anti-aliasing. This system is used automatically for applications programmed using the Qt 3 or GTK+ 2 graphical toolkit.

For compatibility, Community Enterprise Linux includes the original font subsystem, called the core X font subsystem. This system, which is over 15 years old, is based around the X Font Server (xfs).

This section discusses how to configure fonts for X using both systems.

Fontconfig

The Fontconfig font subsystem allows applications to directly access fonts on the system and use Xft or other rendering mechanisms to render Fontconfig fonts with advanced anti-aliasing. Graphical applications can use the Xft library with Fontconfig to draw text to the screen.

Over time, the Fontconfig/Xft font subsystem replaces the core X font subsystem.

The Fontconfig font subsystem does not yet work for OpenOffice.org, which uses its own font rendering technology.

It is important to note that Fontconfig uses the /etc/fonts/fonts.conf configuration file, which should not be edited by hand.

Due to the transition to the new font system, GTK+ 1.2 applications are not affected by any changes made via the Font Preferences dialog (accessed by selecting System (on the panel) > Preferences > Fonts). For these applications, a font can be configured by adding the following lines to the file ~/.gtkrc.mine:

style "user-font" {
 fontset = "<font-specification>"
}
widget_class "*" style "user-font"

Replace <font-specification> with a font specification in the style used by traditional X applications, such as -adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*. A full list of core fonts can be obtained by running xlsfonts or created interactively using the xfontsel command.

Adding Fonts to Fontconfig

Adding new fonts to the Fontconfig subsystem is a straightforward process.

  1. To add fonts system-wide, copy the new fonts into the /usr/share/fonts/ directory. It is a good idea to create a new subdirectory, such as local/ or similar, to help distinguish between user-installed and default fonts.

To add fonts for an individual user, copy the new fonts into the .fonts/ directory in the user's home directory.

Core X Font System

For compatibility, Community Enterprise Linux provides the core X font subsystem, which uses the X Font Server (xfs) to provide fonts to X client applications.

The X server looks for a font server specified in the FontPath directive within the Files section of the /etc/X11/xorg.conf configuration file. Refer to for more information about the FontPath entry.

The X server connects to the xfs server on a specified port to acquire font information. For this reason, the xfs service must be running for X to start. For more about configuring services for a particular runlevel, refer to .

xfs Configuration

The /etc/rc.d/init.d/xfs script starts the xfs server. Several options can be configured within its configuration file, /etc/X11/fs/config.

The following lists common options:

Adding Fonts to xfs

To add fonts to the core X font subsystem (xfs), follow these steps:

  1. If it does not already exist, create a directory called /usr/share/fonts/local/ using the following command as root:
mkdir /usr/share/fonts/local/

If creating the /usr/share/fonts/local/ directory is necessary, it must be added to the xfs path using the following command as root:

chkfontpath --add /usr/share/fonts/local/