To support typeface indirection through abstract styles, and for
compatibility with AT&T troff
, the formatter maintains
a list of font positions at which fonts required by a document are
mounted. An output device’s description file DESC
typically configures a set of pre-mounted fonts; see Device and Font Description Files. A font need not be explicitly mounted before
it is selected; GNU troff
will search GROFF_FONT_PATH
for
it by name and mount it at the first free mounting position on demand.
.fp
pos id [font-description-file-name] ¶\n[.f]
¶\n[.fp]
¶Mount a font under the name id at mounting position pos, a
non-negative integer. When the formatter starts up, it reads the output
device’s description to mount an initial set of faces, and selects font
position 1. Position 0 is unused by default. Unless the
font-description-file-name argument is given, id should be
the name of a font description file stored in a directory corresponding
to the selected output device. GNU troff
does not traverse
directories to locate the font description file.
The optional third argument enables font names to be aliased, which can
be necessary in compatibility mode since AT&T troff
syntax
affords no means of identifying fonts with names longer than two
characters, like ‘TBI’ or ‘ZCMI’, in a font selection escape
sequence. See Compatibility Mode. You can also alias fonts on
mounting for convenience or abstraction. (See below regarding the
.fp
register.)
.fp \n[.fp] SC ZCMI Send a \f(SChand-written\fP thank-you note. .fp \n[.fp] Emph TI .fp \n[.fp] Strong TB Are \f[Emph]these names\f[] \f[Strong]comfortable\f[]?
‘DESC’, ‘P’, and non-negative integers are not usable as font identifiers.
The position of the currently selected font (or abstract style) is available in the read-only register ‘.f’. It is associated with the environment (see Environments).
You can copy the value of .f
to another register to save it for
later use.
.nr saved-font \n[.f]
… text involving many font changes …
.ft \n[saved-font]
The index of the next (non-zero) free font position is available in the
read-only register ‘.fp’.
Fonts not listed in the DESC file are automatically mounted at
position ‘\n[.fp]’ when selected with the ft
request or
\f
escape sequence. When mounting a font at a position
explicitly with the fp
request, this same practice should be
followed, although GNU troff
does not enforce this strictly.