10.2 Installing and Configuring Fonts
The installation of additional fonts in openSUSE is very easy. Simply
copy the fonts to any directory located in the X11 font path (see
Section 10.2.1, X11 Core Fonts). To the enable use
of the fonts, the installation directory should be a subdirectory of the
directories configured in /etc/fonts/fonts.conf (see
Section 10.2.2, Xft) or included into this
file with /etc/fonts/suse-font-dirs.conf.
The following is an excerpt from
/etc/fonts/fonts.conf. This file is the standard
configuration file that should be appropriate for most configurations. It
also defines the included directory
/etc/fonts/conf.d. In this directory, all files or
symbolic links starting with a two digit number are loaded by fontconfig.
For a more detailed explanation of this functionality, have a look at
<!-- Font directory list -->
/etc/fonts/suse-font-dirs.conf is automatically
generated to pull in fonts that ship with (mostly third party)
applications like OpenOffice.org, Java or Adobe Acrobat Reader. Some
typical entries of /etc/fonts/suse-font-dirs.conf
would look like the following:
To install additional fonts systemwide, manually copy the font files to a
suitable directory (as root),
such as /usr/share/fonts/truetype. Alternatively, the
task can be performed with the KDE font installer in the KDE Control
Center. The result is the same.
Instead of copying the actual fonts, you can also create symbolic links.
For example, you may want to do this if you have licensed fonts on a
mounted Windows partition and want to use them. Subsequently, run
SuSEconfig --module fonts .
SuSEconfig --module fonts executes
the script /usr/sbin/fonts-config, which handles the
font configuration. For more information on this script, refer to its
manual page (man fonts-config ).
The procedure is the same for bitmap fonts, TrueType and OpenType fonts,
and Type1 (PostScript) fonts. All these font types can be installed into
X.Org contains two completely different font systems: the old
and the newly designed
system. The following sections
briefly describe these two systems.
10.2.1 X11 Core Fonts
Today, the X11 core font system supports not only bitmap fonts but also
scalable fonts, like Type1 fonts, TrueType, and OpenType fonts.
Scalable fonts are only supported without antialiasing and subpixel
rendering and the loading of large scalable fonts with glyphs for many
languages may take a long time. Unicode fonts are also supported, but
their use may be slow and require more memory.
The X11 core font system has a few inherent weaknesses. It is outdated
and can no longer be extended in a meaningful way. Although it must be
retained for reasons of backward compatibility, the more modern Xft and
fontconfig system should be used if at all possible.
For its operation, the X server needs to know which fonts are available
and where in the system it can find them. This is handled by a
FontPath variable, which contains the path to all
valid system font directories. In each of these directories, a file named
fonts.dir lists the available fonts in this
directory. The FontPath is generated by the X server
at start-up. It searches for a valid fonts.dir file
in each of the FontPath entries in the configuration
file /etc/X11/xorg.conf. These entries are found in
the Files section. Display the actual
xset q. This path may also be
changed at runtime with xset. To add an additional
path, use xset +fp <path>.
To remove an unwanted path, use xset -fp
If the X server is already active, newly installed fonts in mounted
directories can be made available with the command
xset fp rehash. This command is
executed by SuSEconfig --module
fonts. Because the command xset needs access
to the running X server, this only works if
SuSEconfig --module fonts is
started from a shell that has access to the running X server. The easiest
way to achieve this is to assume
root permissions by entering
su and the root password. su
transfers the access permissions of the user who started the X server to
the root shell. To check if the fonts were installed correctly and
are available by way of the X11 core font system, use the command
xlsfonts to list all available fonts.
By default, openSUSE uses UTF-8 locales. Therefore, Unicode fonts
should be preferred (font names ending with iso10646-1
in xlsfonts output). All available Unicode fonts can
be listed with xlsfonts | grep
iso10646-1. Nearly all Unicode fonts available in openSUSE
contain at least the glyphs needed for European languages (formerly
encoded as iso-8859-*).
From the outset, the programmers of Xft made sure that scalable fonts
including antialiasing are supported well. If Xft is used, the fonts are
rendered by the application using the fonts, not by the X server as in
the X11 core font system. In this way, the respective application has
access to the actual font files and full control of how the glyphs are
rendered. This constitutes the basis for the correct display of text in a
number of languages. Direct access to the font files is very useful for
embedding fonts for printing to make sure that the printout looks the
same as the screen output.
In openSUSE, the two desktop environments KDE and GNOME, Mozilla,
and many other applications already use Xft by default. Xft is already
used by more applications than the old X11 core font system.
Xft uses the fontconfig library for finding fonts and influencing how
they are rendered. The properties of fontconfig are controlled by the
global configuration file /etc/fonts/fonts.conf.
Special configurations should be added to
/etc/fonts/local.conf and the user-specific
configuration file ~/.fonts.conf. Each of these
fontconfig configuration files must begin with
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
and end with
To add directories to search for fonts, append lines such as the
However, this is usually not necessary. By default, the user-specific
directory ~/.fonts is already entered in
/etc/fonts/fonts.conf. Accordingly, all you need to
do to install additional fonts is to copy them to
You can also insert rules that influence the appearance of the fonts. For
<edit name="antialias" mode="assign">
to disable antialiasing for all fonts or
<edit name="antialias" mode="assign">
to disable antialiasing for specific fonts.
By default, most applications use the font names
sans-serif (or the equivalent
sans), serif, or
monospace. These are not real fonts but only aliases
that are resolved to a suitable font, depending on the language setting.
Users can easily add rules to ~/.fonts.conf to
resolve these aliases to their favorite fonts:
Because nearly all applications use these aliases by default, this
affects almost the entire system. Thus, you can easily use your favorite
fonts almost everywhere without having to modify the font settings in the
Use the command fc-list to find out which fonts are
installed and available for use. For instance, the command
fc-list returns a list of all fonts. To find out which
of the available scalable fonts (:scalable=true) contain
all glyphs required for Hebrew (:lang=he), their font
names (family), their style (style),
their weight (weight), and the name of the files
containing the fonts, enter the following command:
fc-list ":lang=he:scalable=true" family style weight
The output of this command could look like the following:
DejaVu Sans:style=Bold Oblique:weight=200
Lucida Sans Typewriter:style=Bold:weight=200
Important parameters that can be queried with fc-list:
Table 10-2 Parameters of fc-list
Name of the font family, for example, FreeSans.
The manufacturer of the font, for example, urw.
The font style, such as Medium,
Italic, or Heavy.
The language that the font supports, for example,
de for German, ja for
Japanese, zh-TW for traditional Chinese, or
zh-CN for simplified Chinese.
The font weight, such as 80 for regular or
200 for bold.
The slant, usually 0 for none and
100 for italic.
The name of the file containing the font.
true for outline fonts or
false for other fonts.
true for scalable fonts or
false for other fonts.
true for bitmap fonts or false
for other fonts.
Font size in pixels. In connection with fc-list, this option only
makes sense for bitmap fonts.