Next: Font Families, Up: Using Fonts [Contents][Index]
We use font to refer to any of several means of identifying a typeface: by its mounting position (‘3’), by its identifier (‘TB’), or by an abstract style (‘B’) to be combined with the default family.
The
ft
request selects the typeface
font.
If the argument is absent or
‘P’,
it selects the previously used typeface;
if there is none,
the formatter ignores the request.
If
font
is an integer,
the formatter interprets it as a mounting position;
the font mounted there is selected.
If that position refers to an abstract style,
GNU
troff combines it with the default family
(see
fam
and
\F
below)
to make a resolved font name.
If
font
is
‘DESC’,
if the mounting position is not an abstract style
and no font is mounted there,
or the mounting position is negative,
GNU
troff ignores the request.113
If font matches a style name, it is combined with the default family to make a resolved font name. If not, font is assumed to be resolved already.
The resolved font name is subject to translation (see request ftr
below). Next, the (possibly translated) font name’s mounting position
is looked up; if not mounted, font is sought on the file system as
a font description file and, if located, automatically mounted at the
next available position (see register .fp below). If the font
was mounted using an identifier different from its font description file
name (see request fp below), that file name is then sought. If a
font description file for the resolved font name is not found, GNU
troff emits a warning in category ‘font’ and ignores the
request.
The \f escape sequence is similar, accepting names or mounting
positions of one character f, two characters fn, or
arbitrary length font.
‘\f[]’ selects the previous font. The syntax form ‘\fP’ is
supported for backward compatibility, and ‘\f[P]’ for consistency.
eggs, bacon,
.ft I
spam,
.ft
and sausage.
.br
eggs, bacon, \fIspam,\fP and sausage.
⇒ eggs, bacon, spam, and sausage.
⇒ eggs, bacon, spam, and sausage.
The currently and previously selected fonts are properties of the environment (see Environments).
The read-only string-valued register .fn contains the resolved
font name of the selected font. Copy its value to a string to save it
for later use.
.ds saved-font \n[.fn]
… text involving many font changes …
.ft \*[saved-font]
GNU
troff does not tokenize
\f
when reading it;
the escape sequence updates the environment.
It thus can be used in requests that expect a single-character argument.
We can assign a font to a margin character as follows
(see Miscellaneous).
.mc \f[I]x\f[]
Translate font name f to g. Where the \f
escape sequence,
the F and S conditional expression operators,
and
the ft, ul, bd, cs, tkf,
special, fspecial, fp, or sty requests refer
to f, GNU troff uses g instead. Omit g
or repeat f as g to untranslate f. f and
g need not be mounted fonts.
You can obtain a report of font translations defined by ftr on
the standard error stream with the pftr request.
See Debugging.
Set magnification of mounted font to factor zoom, a
multiplier applied to the type size in thousandths. zoom must be
non-negative. fzoom applies to glyphs when they are formatted,
altering a font’s apparent size in relation to others. A missing or
zero zoom is treated as ‘1000’—no magnification.
font must be a resolved font name, not an abstract style.
Font magnification is transparent to some aspects of GNU troff.
A change of the zoom factor affects scaling of glyph sizes, inter-word
and inter-sentence spaces, and kerning adjustments on the output device,
but not vertical spacing. It is not reflected in registers that
report the requested or current type size, or the minimum inter-word and
supplemental inter-sentence space sizes. It is reflected in
measurements of formatted output: the horizontal drawing position
register hp, interpolation of the \w escape sequence, and
the registers updated by that escape sequence or the formatting of a
glyph in the environment. See Environments.
fzoom can harmonize the apparent cap-heights of fonts from
different families when formatted on the same baseline at the same type
size.
.fzoom HR 900 .fzoom CR 1150 .fzoom PR 950 Times, \F[H]Helvetica\F[], \F[C]Courier\F[], and \F[P]Palatino\F[]. .sp M\F[H]M\F[C]M\F[P]M
The zoom factor of the currently selected font is available in the read-only register ‘.zoom’. It interpolates zero if there is no magnification.
Next: Font Families, Up: Using Fonts [Contents][Index]