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]

Change (increment, decrement) the height of the current font, but not the width. If height is zero, restore the original height. Default scaling unit is ‘z’.

The read-only register .height contains the font height as set by \H.

Currently, only the -Tps and -Tpdf devices support this feature.

\H doesn’t produce an input token in GNU troff. As a consequence, it can be used in requests like mc (which expects a single character as an argument) to change the font on the fly:

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

In compatibility mode, gtroff behaves differently: If an increment or decrement is used, it is always taken relative to the current type size and not relative to the previously selected font height. Thus,

.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 current font by slant degrees. Positive values slant to the right. Only integer values are possible.

The read-only register .slant contains the font slant as set by \S.

Currently, only the -Tps and -Tpdf devices support this feature.

\S doesn’t produce an input token in GNU troff. As a consequence, it can be used in requests like mc (which expects a single character as an argument) to change the font on the fly:

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

This escape is incorrectly documented in the AT&T troff manual; the slant is always set to an absolute value.

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 space 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 space mode is deactivated.

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


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