Next: , Up: Manipulating Type Size and Vertical Spacing   [Contents][Index]


5.20.1 Changing the Type Size

Request: .ps [size]
Request: .ps +size
Request: .ps -size
Register: \n[.s]

Set the type size to, or alter it by, size. ps with no argument restores the previous size. The ps request’s default scaling unit is ‘z’; recall Measurements and see Using Fractional Type Sizes). The formatter rounds the requested size to the nearest valid size (with ties rounding down) within the limits supported by the device, and if the requested size is non-positive, treats it as 1u.

Type size alteration is incorrectly documented in the AT&T troff manual, which claims “if [the requested size] is invalid, the next larger valid size will result, with a maximum of 36”.210

The read-only string-valued register .s interpolates the type size in points as a decimal fraction. To obtain the type size in scaled points, interpolate the .ps register instead.211

Escape sequence: \ssize

The \s escape sequence also determines the type size, but handles a zero argument differently. It supports a variety of syntax forms.

\sn

Set the type size to n typographical points. n must be a single digit.212 If n is ‘0’, restore the previous size.

\s+n
\s-n

Increase or decrease the type size by n typographical points. n must be exactly one digit.

\s(nn

Set the type size to nn typographical points. nn must be exactly two digits. If n is ‘00’, restore the previous size.

\s+(nn
\s-(nn
\s(+nn
\s(-nn

Alter the type size in scaled points by the nn typographical points. nn must be exactly two digits.

Using Fractional Type Sizes presents further syntactical forms of the \s escape sequence that additionally accept decimal fractions.

snap, snap,
.ps +2
grin, grin,
.ps +2
wink, wink, \s+2nudge, nudge,\s+8 say no more!
.ps 10

The formatter does not tokenize \s when reading it; the escape sequence updates the environment.213 It thus can be used in requests that expect a single-character argument. We can alter the type size of a margin character as follows.214

.mc \s[20]x\s[0]
Request: .sizes s1 s2 … sn [0]

Set the available type sizes GNU troff permits.215 Arguments are in scaled points.216 Each can be a single type size (such as ‘12000’), or a range of sizes (such as ‘4000-72000’). You can optionally end the list with a ‘0’.


Next: , Up: Manipulating Type Size and Vertical Spacing   [Contents][Index]