kpathsea: Fontmap
6.3.2 Fontmap
-------------
If a bitmap font or metric file is not found with the original name (see
the previous section), Kpathsea looks through any "fontmap" files for an
"alias" for the original font name. These files are named
'texfonts.map' and searched for along the 'TEXFONTMAPS'
environment/config file variable. All 'texfonts.map' files that are
found are read; earlier definitions override later ones.
This feature is intended to help in two respects:
1. An alias name is limited in length only by available memory, not by
your filesystem. Therefore, if you want to ask for 'Times-Roman'
instead of 'ptmr', you can (you get 'ptmr8r').
2. A few fonts have historically had multiple names: specifically,
LaTeX's "circle font" has variously been known as 'circle10',
'lcircle10', and 'lcirc10'. Aliases can make all the names
equivalent, so that it no longer matters what the name of the
installed file is; TeX documents will find their favorite name.
The format of fontmap files is straightforward:
* Comments start with the last '%' on a line and continue to the end
of the line. (This provides for names that include a %,
ill-advised as that may be.)
* Blank lines are ignored.
* Each nonblank line is broken up into a series of "words": a
sequence of non-whitespace characters.
* If the first word is 'include', the second word is used as a
filename, and it is searched for and read.
* Otherwise, the first word on each line is the true filename;
* the second word is the alias;
* subsequent words are ignored.
If an alias has an extension, it matches only those files with that
extension; otherwise, it matches anything with the same root, regardless
of extension. For example, an alias 'foo.tfm' matches only when
'foo.tfm' is being searched for; but an alias 'foo' matches 'foo.vf',
'foo.600pk', etc.
As an example, here is an excerpt from the 'texfonts.map' in the
Web2c distribution. It makes the old and new names of the LaTeX circle
fonts equivalent.
circle10 lcircle10
circle10 lcirc10
lcircle10 circle10
lcircle10 lcirc10
lcirc10 circle10
lcirc10 lcircle10
...
Fontmaps are implemented in the file 'kpathsea/fontmap.c'. The
Fontname distribution has much more information on font naming (⇒
(fontname)).