It is possible to add additional fonts to your system. If you want to add fonts to any of the default subdirectories in /usr/lib/X11/fonts, you must be logged in as root. You should also ensure that /usr/bin/X11 has been added to root's $PATH environment variable.
To add one or more fonts to your X server, perform the following steps. You must be logged onto the system as root.
When you add new fonts to your system, you need to give some thought to where you want to put the actual font files. Generally, fonts are located in subdirectories of /usr/lib/X11/fonts. You can put your new fonts in one of these subdirectories, perhaps in /usr/lib/X11/fonts/misc, or anywhere else on the system, including subdirectories within individual users' accounts.
New font files can be in Bitmap Display Format (BDF), Server Natural Format (SNF), or Portable Compiled Format (PCF). See Step 2 for more information on these formats.
The standard font format is Bitmap Display Format (BDF). BDF font files are portable and represent the characters of a font in ASCII. These files generally have a .bdf extension. Fonts can also be compiled in the Portable Compiled Format (PCF). PCF font files generally have a .pcf extension.
The X server can use font files that are in BDF, PCF, or SNF format. However, there are several good reasons to convert any BDF files on your system into PCF files:
To convert BDF font files to PCF files,
run the following command:
bdftopcf font.bdf > font.pcf
font.bdf refers to the actual name of the BDF font file that you want to convert. The file font.pcf contains the converted font.
If you run the bdftopcf utility from a directory other than the one containing the BDF file you want converted, remember to specify the complete pathname of the file.
For more information on the flags that you can use with the bdftopcf command, see the bdftopcf(X) manual page.
If you add new fonts to an existing fonts directory or create an entirely new fonts directory, you must run the mkfontdir command. This command checks for the existence of a fonts.dir file in the directory that contains the new fonts. If such a file exists, mkfontdir adds an entry for each new font to the file. If the font directory is new and does not already have a fonts.dir file, mkfontdir creates the file for you.
If you run mkfontdir from the directory containing
the new fonts, you do not need to specify the directory name.
By default, the mkfontdir command operates
on the current working directory.
If, however, you run mkfontdir from a different
location on your system, you must specify
the complete path of the directory containing the new
files. For example, if you added new fonts to the
misc directory, you should enter:
If you added new fonts to a subdirectory named myfonts
within your home directory, you should enter:
If you placed your new font files in a directory that is not
part of the font search path, you need to add the font
directory to the search path so the X server can locate
the new files. You can tell the server of the new directory
using xset and the fp+ option:
xset fp+ font_location
For example, if you added fonts to a subdirectory called
myfonts in your home directory, the following
command appends the directory $HOME/myfonts
to the X server's font search path:
xset fp+ $HOME/myfonts
You can add multiple directories to the font path at the
same time. After the fp option, each font
directory should be separated by commas, as below:
xset fp+ $HOME/myfonts,/usr/lib/X11/fonts/newfonts
To complete the font installation, you must make the X server
aware of the additions to the font database. The font files
must be located in a directory included in the font
search path. To reset the font database, enter the following:
xset fp rehash
This command tells the X server to reread all of the
fonts.dir and fonts.alias files in
the current font path. You should now be able to use
your new fonts in a resource file or on the command line.