A TFM font contains at most 256 characters, represented by numerical codes (called character codes). Some general information about the font’s characters is available through the following accessors.
min-code
and max-code
: respectively the smallest and
greatest character codes for this font.
character-count
: the number of characters defined in this font.
Note that some characters between min-code
and max-code
may not be defined, so the character count may be smaller than
max-code - min-code + 1. Also, the character count doesn’t
include a potential boundary character (see below), unless it exists for
real in the font (it has non-zero metrics).
boundary-character
: the font’s boundary character if defined, or
nil
. The boundary character is the only character the code of which
is allowed to be outside the [min-code,max-code] range. If this
character doesn’t exist for real in the font, it has zero metrics and is
not included in the character count.
The characters in a font are individually accessible by their code,
thanks to the following function (when this function returns nil
, it
means that no character is defined for the code in question).
Return FONT’s CODE character, or nil
.
This function actually returns an instance of a class called
character-metrics
, which contains character-specific data. In the
context of this library, the term “character” denotes an instance of
this class. The following accessors return the different character
properties available.
code
: the character code
which makes it accessible from
the font instance (see the function get-character
).
font
: the font the character belongs to.
width
, height
, and depth
: the character box
dimensions, in design size units (but see Freezing).
italic-correction
: the character’s italic correction, in design
size units (but see Freezing). TeX uses this value for regular
characters followed by the command \/
, and also in math mode for
superscript placement.
next-character
: the next character in a character list, or
nil
. If non-nil
, this character is part of a chain of characters
of ascending size, and not the last one (see TeX: the Program [544]).
It is mutually exclusive with the existence of an extension recipe (see
below), and also with the existence of a ligature or kerning program for
this character (see Ligatures and Kernings).
Some characters are said to be “extensible” (meaning that they are constructed out of up to four components, themselves characters). To test whether a character is extensible, use the following function.
Return T
if CHARACTER has an extension recipe.
When a character is extensible, the four components of the extension
recipe may be retrieved with the top-
, middle-
,
bottom-
, and repeated-character
accessors. These functions
return a character, or nil
if the corresponding component isn’t used
in the recipe. Note however that a repeated character always exists in
an extension recipe (so only the top, middle, and bottom characters may
be nil
).