Next: , Previous: , Up: Using Fonts   [Contents][Index]


5.19.7 Artificial Fonts

There are a number of requests and escape sequences for artificially creating fonts. These are largely vestiges of the days when output devices did not have a wide variety of fonts, and when nroff and troff were separate programs. Most of them are no longer necessary in GNU troff. Nevertheless, they are supported.

Escape sequence: \H'height'
Escape sequence: \H'+height'
Escape sequence: \H'-height'
Register: \n[.height]

Set (increment, decrement) the height of the current font, but not its width. If height is zero, the formatter uses the font’s inherent height for its type size. The default scaling unit is ‘z’.

Changing the font height does not affect vertical spacing; dramatic changes may be better accompanied by an \x escape sequence to add extra pre-vertical space to the output line. Recall Manipulating Spacing.

The read-only register .height interpolates the font height.

As of this writing, only the ps and pdf output devices support this feature.

The formatter does not tokenize \H when reading it; the escape sequence updates the environment.126 It thus can be used in requests that expect a single-character argument. We can alter the font height of a margin character127 as follows.

.mc \H'+5z'x\H'0'

In compatibility mode, GNU troff behaves differently: it applies an increment or decrement to the current type size and not to the previously selected font height.

.cp 1
\H'+5'test \H'+5'test

prints the word ‘test’ twice with the same font height—five points larger than the current font size.

Escape sequence: \S'slant'
Register: \n[.slant]

Slant the glyphs of the currently selected font by slant degrees. Positive values slant in the direction of text flow. Only integer values are possible.

The read-only register .slant interpolates the font slant.

As of this writing, only the ps and pdf output devices support this feature.

The formatter does not tokenize \S when reading it; the escape sequence updates the environment.128 It thus can be used in requests that expect a single-character argument. We can apply a slant to a margin character129 as follows.

.mc \S'20'x\S'0'

This escape sequence is incorrectly documented in the AT&T troff manual: the slant is only assigned, never incremented or decremented.

Request: .ul [lines]

The ul request normally underlines subsequent lines if a TTY output device is used. Otherwise, the lines are printed in italics (only the term ‘underlined’ is used in the following). The single argument is the quantity of input lines to be underlined; with no argument, the next line is underlined. If lines is zero or negative, stop the effects of ul (if it was active). Requests and empty lines do not count for computing the number of underlined input lines, even if they produce some output like tl. Lines inserted by macros (e.g., invoked by a trap) do count.

At the beginning of ul, the current font is stored and the underline font is activated. Within the span of a ul request, it is possible to change fonts, but after the last line affected by ul the saved font is restored.

This number of lines still to be underlined is associated with the environment (see Environments). The underline font can be changed with the uf request.

The ul request does not underline spaces.

Request: .cu [lines]

The cu request is similar to ul but underlines spaces as well (if a TTY output device is used).

Request: .uf font

Set the underline font (globally) used by ul and cu. By default, this is the font at position 2. font can be either a non-negative font position or the name of a font.

Request: .bd font [offset]
Request: .bd font1 font2 [offset]
Register: \n[.b]

Embolden font by overstriking its glyphs offset by offset units minus one.

Two syntax forms are available.

Request: .cs font [width [em-size]]

Switch to and from constant glyph spacing mode. If activated, the width of every glyph is width/36 ems. The em size is given absolutely by em-size; if this argument is missing, the em value is taken from the current font size (as set with the ps request) when the font is effectively in use. Without second and third argument, constant glyph spacing mode is deactivated.

Default scaling unit for em-size is ‘z’; width is an integer.


Next: , Previous: , Up: Using Fonts   [Contents][Index]