.TH mkfontdir "" "" "X Utility"
.PC "Create file fonts.dir from directory of font files"
\fBmkfontdir [\fIdirectory ...\^\fB]\fR
.PP
.II fonts.dir
The X utility
.B mkfontdir
constructs a table of font names.
For every
.IR directory ,
it reads every font file
and constructs a font name for the font in that file.
.B mkfontdir
derives the font name from the property
.B FONT
within the font file, or, if the file contains no such property,
from name of the font file stripped of its suffix.
.B mkfontdir
writes the name of each font and the file that contains into file
.BR fonts.dir
in
.IR directory .
.PP
The kinds of font files that
.B mkfontdir
reads depends on configuration parameters,
but typically include PCF fonts (suffix, \fB.pcf\fR),
SNF fonts (suffix, \fB.snf\fR),
and BDF fonts (suffix, \fB.bdf\fR).
If a font exists in multiple formats,
.B mkfontdir
first chooses PCF, then SNF, and finally BDF.
.SH "Scalable Fonts"
Because scalable-font files do not usually include the X font name,
you must edit by hand the file
.B fonts.dir
in a directory that contains such fonts,
to include the appropriate entries for these fonts.
However, when you run
.BR mkfontdir ,
it will erase all of those additions, so be careful.
.SH "Font Name Aliases"
Both the X server and the font server look for files
.B fonts.dir
and
.B fonts.alias
in each directory in the font path each time it is set.
.PP
The file
.BR fonts.alias ,
which can be put in any directory of the font path,
maps new names to existing fonts, and should be edited by hand.
The format is straightforward:
two columns separated by white space,
first of which contains aliases and the second of which contains
font-name patterns.
.PP
When you use a font alias, the X server looks through each font directory
in turn, and searches in the normal manner for the name the alias references.
This means that the aliases need not mention fonts in the same directory
as the alias file.
.PP
To embed white-space in either name, simply enclose them in quotation marks.
To embed a literal quotation mark (or any other character), precede it
with backslash `\e'.
For example:
.DM
.ta 0.5i 2.5i
	"magic-alias with spaces"	"\e"font\ename\e" with quotes"
	regular-alias			fixed
.DE
.PP
If the string
.B FILE_NAMES_ALIASES
stands alone on a line,
each file-name in the directory (stripped of its suffix)
is used as an alias for that font.
.SH "See Also"
.B 
fs,
xset,
X utilities
.R
