Next: , Previous: , Up: GNU troff Reference   [Contents][Index]

5.19 Using Fonts

In digital typography, a font is a collection of characters in a specific typeface that a device can render as glyphs at a desired size.72 A roff formatter can change typefaces at any point in the text. The basic faces are a set of styles combining upright and slanted shapes with normal and heavy stroke weights: ‘R’, ‘I’, ‘B’, and ‘BI’—these stand for roman, italic, bold, and bold-italic. For linguistic text, GNU troff groups typefaces into families containing each of these styles.73 A text font is thus often a family combined with a style, but it need not be: consider the ps and pdf devices’ ZCMI (Zapf Chancery Medium italic)—often, no other style of Zapf Chancery Medium is provided. On typesetting devices, at least one special font is available, comprising unstyled glyphs for mathematical operators and other purposes.

Like AT&T troff, GNU troff does not itself load or manipulate a digital font file;74 instead it works with a font description file that characterizes it, including its glyph repertoire and the metrics (dimensions) of each glyph.75 This information permits the formatter to accurately place glyphs with respect to each other. Before using a font description, the formatter associates it with a mounting position, a place in an ordered list of available typefaces. So that a document need not be strongly coupled to a specific font family, in GNU troff an output device can associate a style in the abstract sense with a mounting position. Thus the default family can be combined with a style dynamically, producing a resolved font name.

Fonts often have trademarked names, and even Free Software fonts can require renaming upon modification. groff maintains a convention that a device’s serif font family is given the name ‘T’ (“Times”), its sans-serif family ‘H’ (“Helvetica”), and its monospaced family ‘C’ (“Courier”). Historical inertia has driven groff’s font identifiers to short uppercase abbreviations of font names, as with ‘TR’, ‘TI’, ‘TB’, ‘TBI’, and a special font ‘S’.

The default family used with abstract styles can be changed at any time; initially, it is ‘T’. Typically, abstract styles are arranged in the first four mounting positions in the order shown above. The default mounting position, and therefore style, is always ‘1’ (‘R’). By issuing appropriate formatter instructions, you can override these defaults before your document writes its first glyph.

Terminal output devices cannot change font families and lack special fonts. They support style changes by overstriking, or by altering ISO 6429/ECMA-48 graphic renditions (character cell attributes).

Next: , Previous: , Up: GNU troff Reference   [Contents][Index]