For each directory argument, mkfontdir 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 converted to lower case and 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 depends on configuration parameters, but typically include PCF (suffix ".pcf"), SNF (suffix ".snf"), BDF (suffix ".bdf"), F3 (suffix ".f3b") and F3 bitmap (suffix ".fb"). If a font exists in multiple formats, mkfontdir will first choose fonts in fonts in the following order: F3, PCF, SNF, BDF and finally F3 bitmap (.fb).
There is an alternative to editing "fonts.dir" file by hand. If there exists a "fonts.scale" file in any directory of the font-path, mkfontdir will copy the contents of this file to "fonts.dir" file. Any changes can therefore be safely made to "fonts.scale" and when mkfontdir is run in that directory, the changes will be reflected in the "fonts.dir" file also.
For example, the directory /usr/openwin/lib/X11/fonts/Speedo contains a "fonts.scale" file, which is hand created. The format of a "fonts.scale" file is as follows:
<num-of-entries> filename XLFD name
Note: F3 scalable fonts do contain enough information for mkfontdir to be able to construct the X font name (XLFD name). Therefore, the above does not apply to F3 format font files.
When a font alias is used, the name it references is search for in the normal manner, looking through each font directory 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 them in double-quote marks, to embed double-quote marks (or any other character), precede them with back-slash:
"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 it’s suffix) will be used as an alias for that font.