A glyph is a graphical representation of a character. While a character is an abstract entity containing semantic information, a glyph is something which can be actually seen on screen or paper. It is possible that a character has multiple glyph representation forms (for example, the character `A' can be either written in a roman or an italic font, yielding two different glyphs); sometimes more than one character maps to a single glyph (this is a ligature – the most common is `fi').
A symbol is simply a named glyph. Within
gtroff, all glyph
names of a particular font are defined in its font file. If the user
requests a glyph not available in this font,
gtroff looks up an
ordered list of special fonts. By default, the PostScript
output device supports the two special fonts ‘SS’ (slanted symbols)
and ‘S’ (symbols) (the former is looked up before the latter).
Other output devices use different names for special fonts. Fonts
mounted with the
fonts keyword in the DESC file are
globally available. To install additional special fonts locally (i.e.
for a particular font), use the
Here the exact rules how
gtroff searches a given symbol:
charrequest, use it. This hides a symbol with the same name in the current font.
fcharrequest, use it.
fspecialcall if appropriate.
fscharrequest for the current font, use it.
scharrequest, use it.
fontsline in the DESC file often contains empty positions which are filled later on. For example, consider the following:
fonts 3 0 0 FOO
This mounts font
foo at font position 3. We assume that
FOO is a special font, containing glyph
foo, and that no
font has been loaded yet. The line
.fspecial BAR BAZ
BAZ special only if font
BAR is active. We
further assume that
BAZ is really a special font, i.e., the font
description file contains the
special keyword, and that it also
foo with a special shape fitting to font
BAR. After executing
BAR is loaded
at font position 1, and
BAZ at position 2.
We now switch to a new font
XXX, trying to access glyph
foo which is assumed to be missing. There are neither
font-specific special fonts for
XXX nor any other fonts made
special with the
special request, so
gtroff starts the
search for special fonts in the list of already mounted fonts, with
increasing font positions. Consequently, it finds
FOO even for
XXX which is not the intended behaviour.
See Font Files, and Special Fonts, for more details.
The list of available symbols is device dependent; see the groff_char(7) man page for a complete list of all glyphs. For example, say
man -Tdvi groff_char > groff_char.dvi
for a list using the default DVI fonts (not all versions of the
man program support the -T option). If you want to use
an additional macro package to change the used fonts,
be called directly:
groff -Tdvi -mec -man groff_char.7 > groff_char.dvi
Glyph names not listed in groff_char(7) are derived algorithmically, using a simplified version of the Adobe Glyph List (AGL) algorithm which is described in http://partners.adobe.com/public/developer/opentype/index_glyph.html. The (frozen) set of glyph names which can't be derived algorithmically is called groff glyph list (GGL).
uXXXX[X[X]]. X must be an uppercase hexadecimal digit. Examples:
u12DB8. The largest Unicode value is 0x10FFFF. There must be at least four
Xdigits; if necessary, add leading zeroes (after the ‘u’). No zero padding is allowed for character codes greater than 0xFFFF. Surrogates (i.e., Unicode values greater than 0xFFFF represented with character codes from the surrogate area U+D800-U+DFFF) are not allowed too.
‘u’ component1 ‘_’ component2 ‘_’ component3 ...
For simplicity, all Unicode characters which are composites must be
decomposed maximally (this is normalization form D in the Unicode
standard); for example,
u00CA_0301 is not a valid glyph name
since U+00CA (latin capital letter e with circumflex) can be
further decomposed into U+0045 (latin capital letter e) and U+0302
(combining circumflex accent).
u0045_0302_0301 is thus the
glyph name for U+1EBE, latin capital letter e with circumflex and
u0100(latin letter a with macron) is automatically decomposed into
u0041_0304. Additionally, a glyph name of the GGL is preferred to an algorithmically derived glyph name; groff also automatically does the mapping. Example: The glyph
u0045_0302is mapped to
Insert a symbol name (two-character name nm) or a composite glyph with component glyphs component1, component2, ... There is no special syntax for one-character names – the natural form ‘\n’ would collide with escapes.1
If name is undefined, a warning of type ‘char’ is generated, and the escape is ignored. See Debugging, for information about warnings.
\[...]with more than a single component as follows:
- Any component which is found in the GGL is converted to the
- Any component
uXXXX which is found in the list of decomposable glyphs is decomposed.
- The resulting elements are then concatenated with ‘_’ in between, dropping the leading ‘u’ in all elements but the first.
No check for the existence of any component (similar to
trrequest) is done.
- ‘A’ maps to
u0041, ‘ho’ maps to
u02DB, thus the final glyph name would be
u0041_02DB. Note this is not the expected result: The ogonek glyph ‘ho’ is a spacing ogonek, but for a proper composite a non-spacing ogonek (U+0328) is necessary. Looking into the file composite.tmac one can find ‘.composite ho u0328’ which changes the mapping of ‘ho’ while a composite glyph name is constructed, causing the final glyph name to be
\[E a^ aa]
\[E ^ ']
- ‘^E’ maps to
u0045_0302, thus the final glyph name is
u0045_0302_0301in all forms (assuming proper calls of the
It is not possible to define glyphs with names like ‘A ho’ within a groff font file. This is not really a limitation; instead, you have to define
Typeset the glyph named xxx.2 Normally it is more convenient to use
\Chas the advantage that it is compatible with newer versions of AT&T
troffand is available in compatibility mode.
This mapping is based on glyph names only; no check for the existence of either glyph is done.
A set of default mappings for many accents can be found in the file composite.tmac which is loaded at start-up.
Typeset the glyph with code n in the current font (
nis not the input character code). The number n can be any non-negative decimal integer. Most devices only have glyphs with codes between 0 and 255; the Unicode output device uses codes in the range 0–65535. If the current font does not contain a glyph with that code, special fonts are not searched. The
\Nescape sequence can be conveniently used in conjunction with the
charrequest:.char \[phone] \f[ZD]\N'37'
The code of each glyph is given in the fourth column in the font description file after the
charsetcommand. It is possible to include unnamed glyphs in the font description file by using a name of ‘---’; the
\Nescape sequence is the only way to use these.
No kerning is applied to glyphs accessed with
Some escape sequences directly map onto special glyphs.
Input characters and symbols have certain properties associated with it.3 These properties can be modified with the
cflagsrequest. The first argument is the sum of the desired flags and the remaining arguments are the characters or symbols to have those properties. It is possible to omit the spaces between the characters or symbols. Instead of single characters or symbols you can also use character classes (see Character Classes for more details).
- The character ends sentences (initially characters ‘.?!’ have this property).
- Lines can be broken before the character (initially no characters have this property). This only works if both the characters before and after have non-zero hyphenation codes (as set with the
hcoderequest). Use value 64 to override this behaviour.
- Lines can be broken after the character (initially the character ‘-’ and the symbols ‘\[hy]’ and ‘\[em]’ have this property). This only works if both the characters before and after have non-zero hyphenation codes (as set with the
hcoderequest). Use value 64 to override this behaviour.
- The character overlaps horizontally if used as a horizontal line building element. Initially the symbols ‘\[ul]’, ‘\[rn]’, ‘\[ru]’, ‘\[radicalex]’, and ‘\[sqrtex]’ have this property.
- The character overlaps vertically if used as vertical line building element. Initially symbol ‘\[br]’ has this property.
- An end-of-sentence character followed by any number of characters with this property is treated as the end of a sentence if followed by a newline or two spaces; in other words the character is transparent for the purposes of end-of-sentence recognition – this is the same as having a zero space factor in TeX (initially characters ‘"')]*’ and the symbols ‘\[dg]’ and ‘\[rq]’ have this property).
- Ignore hyphenation code values of the surrounding characters. Use this in combination with values 2 and 4 (initially no characters have this property). For example, if you need an automatic break point after the hyphen in number ranges like `3000-5000', insert.cflags 68 -
into your document. Note, however, that this can lead to bad layout if done without thinking; in most situations, a better solution instead of changing the
cflagsvalue is to insert
\:right after the hyphen at the places which really need a break point.
- Prohibit a line break before the character, but allow a line break after the character. This works only in combination with flags 256 and 512 (see below) and has no effect otherwise.
- Prohibit a line break after the character, but allow a line break before the character. This works only in combination with flags 128 and 512 (see below) and has no effect otherwise.
- Allow line break before or after the character. This works only in combination with flags 128 and 256 and has no effect otherwise.
Contrary to flag values 2 and 4, the flags 128, 256, and 512 work pairwise. If, for example, the left character has value 512, and the right character 128, no line break gets inserted. If we use value 6 instead for the left character, a line break after the character can't be suppressed since the right neighbour character doesn't get examined.
Define a new glyph g to be string (which can be empty).4 Every time glyph g needs to be printed, string is processed in a temporary environment and the result is wrapped up into a single object. Compatibility mode is turned off and the escape character is set to ‘\’ while string is being processed. Any emboldening, constant spacing or track kerning is applied to this object rather than to individual characters in string.
A glyph defined by these requests can be used just like a normal glyph provided by the output device. In particular, other characters can be translated to it with the
trinrequests; it can be made the leader character by the
lcrequest; repeated patterns can be drawn with the glyph using the
\Lescape sequences; words containing the glyph can be hyphenated correctly if the
hcoderequest is used to give the glyph's symbol a hyphenation code.
There is a special anti-recursion feature: Use of
gwithin the glyph's definition is handled like normal characters and symbols not defined with
Note that the
trinrequests take precedence if
characcesses the same symbol..tr XY X ⇒ Y .char X Z X ⇒ Y .tr XX X ⇒ Z
fcharrequest defines a fallback glyph:
gtroffonly checks for glyphs defined with
fcharif it cannot find the glyph in the current font.
gtroffcarries out this test before checking special fonts.
fschardefines a fallback glyph for font f:
gtroffchecks for glyphs defined with
fscharafter the list of fonts declared as font-specific special fonts with the
fspecialrequest, but before the list of fonts declared as global special fonts with the
scharrequest defines a global fallback glyph:
gtroffchecks for glyphs defined with
scharafter the list of fonts declared as global special fonts with the
specialrequest, but before the already mounted special fonts.
See Using Symbols, for a detailed description of the glyph searching mechanism in
It is possible to omit the whitespace between arguments.
rfscharremoves glyph definitions defined with
fscharfor glyph f.
See Special Characters.
that a one-character symbol is not the same as an input character, i.e.,
a is not the same as
\[a]. By default,
groff defines only a single one-character symbol,
is usually accessed as
\-. On the other hand,
the special feature that
] is the same as the
input character with character code XXX. For example,
\[char97] is identical to the letter
a if ASCII
encoding is active.
\C is actually a
misnomer since it accesses an output glyph.
 Note that the output glyphs themselves don't have such
gtroff, a glyph is a numbered box with a given
width, depth, and height, nothing else. All manipulations with the
cflags request work on the input level.
char is a misnomer since an output glyph is