Naming convention: XLFD
Starting with X11 Release 3, fonts have been named using the following
This naming convention is known as the "X Logical Font Description",
or XLFD. The fields are defined as follows:
||The name of the company that digitized the font.
||The typeface family - Courier, Times Roman, Helvetica, etc.
||The "blackness" of the font - bold, medium, demibold, etc.
||The "posture" of the font. "R" for upright, "I" for italic, etc.
||Typographic proportionate width of the font.
||Additional typographic style information.
||Size of the font in device-dependent pixels
||Size of the font in device-independent points
||Horizontal dots-per-inch for which the font was designed.
||Vertical dots-per-inch for which the font was designed
||The spacing class of the font. "P" for proportional, "M" for
||Average width of all glyphs in the font
||Tells the language the characters conform to. (iso8859 = Latin characters)
||Further language encoding information
Here's a sample font name. This is the XLFD name for the "fixed"
How to access a Font
Each font can be accessed using the full XLFD name, the alias name (if
there is an alias for the font you want), or by wildcarding certain parts
of the XLFD name. For example, if you want to start xterm using the
"6x10" font, you can use any of these commands:
xterm -fn 6x10
xterm -fn -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
or possibly by using this command:
xterm -fn "-misc-fixed-*--10-100-*-iso8859-1"
The word possibly is used in the last sentence because the
X server will search through all fonts in the font path, one
by one, until it finds one whose XLFD name matches the wildcarded XLFD
The default font path for the X server is set up in different ways.
For the R3 X server, the file /usr/lib/X11/Xdeffontpath contains
the default font path. For the R5 X server, there is an entry in
gives the font path. For X-stations, the font path is set up in the
config file loaded by the X-station. For R6 X Servers,
there is an entry in /etc/X11/XF86config that gives the font
Determining the Font Path
Fonts are stored in the directory /usr/X11R6/lib/X11/fonts.
There are several directories of fonts here, including misc, 100dpi,
75dpi, pcf, Type1, and 34XX. To find out which fonts your X server
is accessing, you need to find out which directories it is searching for
fonts in. Use the command xset -q to see the "Font Path".
For the R5 X server, the default font path is:
For an R6 X server, the default font path is:
How Fonts are Stored
Each directory in the font path contains font files, along with two special
files: fonts.dir and fonts.alias. The fonts.dir
file's first line contains a number, which tells the number of font
files in that directory, and is followed by a line for each font file in
the following format:
file name XLFD name
The fonts.alias contains lines in the following format:
To list all fonts that are available, or to get a listing of all fonts
that match a certain pattern, use the xlsfonts utility. This
utility can also be used to extract detailed information about the font,
including all XLFD properties and other typographic properties.
From the previous example, we can see which font will match the wildcarded
xlsfonts -fn "-misc-fixed-*--10-100-*-iso8859-1"
which is the full name for the "6x10" font after all.
The xfontsel client provides an easy way to choose a font by building
the XLFD font name section by section. Xfontsel pops up a window,
with the 14 XLFD fields each in a button. The user can select settings
for each field, and see what the font that matches the resulting font name
The xfd client displays all the glyphs in a given font. It
also allows the user to choose glyphs one at a time, and displays
the typographic properties of that glyph.
The xset client allows you to change the "font path" to your liking.
To change the font path, use the following command:
xset also allows the user to "rehash" the font path. This
causes the X server to re-read each font path directory's fonts.dir and
fonts.alias files, so that missing entries can be made to these files or
extraneous entries can be removed.
xset fp <directory>,<directory>,<directory>...
xset fp rehash
If for some reason the "fonts.dir" entry gets corrupted in one of the font
path directories, you can use the mkfontdir utility to re-create
However, if the "fonts.alias" file is corrupted, there is no way
to re-create it. You need to copy a good fonts.alias from another
system, and then run xset fp rehash to re-read the alias file.
The .bdf (Bitmapped Distribution Format) font format is the "source"
version of each font. It is a text file which contains all the XLFD
resource values, along with bitmaps of every glyph in the font.
The .snf (Server Natural Format) font format is the "compiled" version
of each font, which is used by X servers previous to R5. The
fonts are compiled using the bdftosnf format. The .snf font
data must match the architecture of the X server that is using it (bit
and byte order, padding,etc.) A good example of this can be found
here at MCPD-Columbia; the X-Stations we have require a different byte
order than the R3 X server. Thus, we havethe "xstatsup" package,
which contains all the .snf fonts from the "xfonts" package, but in a different
The .pcf (Portable Compiled Format) font format is new for X11 R5
X servers. This format eliminates the architecture-dependent requirements
of the .snf format. All X11 R5 servers and X stations will be able
to use the same versions of .pcf font files.
The .spd (Speedo) fonts are a type of "scalable" font. They
are able to adapt their "pixels", "points", "horiz", "vert", and "avgwidth"
XLFD values to match whatever value is requested by the X server.
Scalable fonts are new to X11R5, and will only work on X11 R5 X servers
and X stations.
The .pfa (Type1) fonts are another set of scalable fonts.
X11R5 provides a "font server". Basically, the font server allows
one or more machines to share all or some of its fonts over the network.
Thus, you won't need to install "xfonts" on systems running the R5 X server;
they can load their fonts over the network from the font server.
Accessing a shared font
To access shared fonts, the following entry needs to be added to the font
tcp/server_name/port_number/:[directory, directory, ...]
When the R5 X server sees an entry beginning with "tcp/" in the font
path, it knows to try to connect to the specified server over the port
to access the specified directories, if any.
The system that shares fonts runs the font server client xfs.
This program reads the file /usr/X11R6/lib/X11/xfs/config.
This file lists the font directories which the server should export.