mkfontdir - create fonts.dir file from directory of font files


mkfontdir [directory-names]


For each directory argument, mkfontdir(1) reads all of the font files in the directory searching for properties named "FONT", or (failing that) the name of the file stripped of its suffix. These are used as font names, which are written out to the file "fonts.dir" in the directory along with the name of the font file.

The kinds of font files read by mkfontdir(1) depends on configuration parameters, but typically include PCF (suffix ".pcf"), SNF (suffix ".snf") and BDF (suffix ".bdf"). If a font exists in multiple formats, mkfontdir(1) will first choose PCF, then SNF and finally BDF.


Because scalable font files do not usually include the X font name, the fonts.dir file in directories containing such fonts must be edited by hand to include the appropriate entries for those fonts. Be aware, however, that when mkfontdir(1) is run, all of those additions will be lost, so be careful.


The file fonts.alias, which can be put in any directory of the font-path, is used to map new names to existing fonts, and should be edited by hand. The format is straightforward: two white-space separated columns, the first containing aliases, and the second containing font-name patterns.

When a font alias is used, the name it references is searched for in the normal manner; each font directory is scrutinized in turn. This means that the aliases need not mention fonts in the same directory as the alias file.

To embed white space in either name, simply enclose the name in double quotation marks ("). To embed quotation marks (or any other character), precede them with backslash (\):

"magic-alias with spaces"	 "\"font\name\" with quotes"
regular-alias			fixed

If the string "FILE_NAMES_ALIASES" stands alone on a line, each file-name in the directory (stripped of its suffix) will be used as an alias for that font.


Both the X server and the Font Server look for fonts.dir and fonts.alias files in each directory in the font path each time it is set (see xset(1)).