troff/nroff, fonts

changing font styles

.ft B
.ft I
.ft R
.ft N
push bold, italian, roman font, or font mounted on position N, respectively.
.ft P
.ft
pop a font. The font stack has only a height of one, so if you don't restore immediately after the change, your previous font is lost.
\fX
does a .ft X in the middle of a line.

mounting fonts

.fp N X
mounts font X on font position N. The manual says font positions run from 1 to 4, but at my site, they run from 1 to 8. We usually use them like this:
1
PR
2
PI
3
PB
4
S
5
H (Helvetica)
6
HO (Helvetica Oblique)
7
HB (Helvetica Bold)
8
C (Courier)
The read-only number register
.f
contains the number of the current font.

resizing fonts

There is a

.fz S F N
request that does an implicit resize whenever you enter and exit a font, but I can't get it to run, and the manual doesn't make sense to me.

italicising

.ul N
makes the next N lines (default: 1) print underlined (in nroff) or in italics (in troff). .f is saved and restored. The manual claims that the lines output by a .tl request don't count towards the total number of lines in an .ul, but I can't get .ul to work enough to test this.

boldening by overstrike

.bd N U
emboldens the font mounted on N by shifting U units to the right and printing again. The manual says this mode ``must be still or again in effect when the characters are physically printed,'' but I've tried it without ever physically printing anything, and it worked, so it must mean something else.

ligatures

.lg mode
sets the ligature mode. The meaning of mode is
0
no ligatures
2
only two-character ligatures (no ffi and ffl)
else
turn on ligatures
Our particular system makes no difference between 2 and 1 mode; it doesn't seem to understand genuine ffi and ffl ligatures. Of the five ligature string registers that are supposed to be present, only fi and fl work with our SunOS troff; all work with groff.
fi
\(fi (works)
fl
\(fl (works)
ff
\(ff
ffi
\(Fi
ffl
\(Fl