Previous Next
394
CHAPTER 5 Text
cation to determine glyph positioning without having to look inside the font
program.) The operators for showing text are designed on the assumption that
glyphs are ordinarily positioned according to their standard widths. However,
means are provided to vary the positioning in certain limited ways. For example,
the TJ operator enables the text position to be adjusted between any consecutive
pair of glyphs corresponding to characters in a text string. There are graphics
state parameters to adjust character and word spacing systematically.
In addition to width, a glyph has several other metrics that influence glyph posi-
tioning and painting. For most font types, this information is largely internal to
the font program and is not specified explicitly in the PDF font dictionary. How-
ever, in a Type 3 font, all metrics are specified explicitly (see Section 5.5.4, “Type
3 Fonts”).
The glyph coordinate system is the space in which an individual character’s glyph
is defined. All path coordinates and metrics are interpreted in glyph space. For all
font types except Type 3, the units of glyph space are one-thousandth of a unit of
text space; for a Type 3 font, the transformation from glyph space to text space is
defined by a font matrix specified in an explicit FontMatrix entry in the font.
Figure 5.4 shows a typical glyph outline and its metrics.
Glyph
bounding
box
Next
Glyph glyph
origin origin
Glyph width
FIGURE 5.4 Glyph metrics
The glyph origin is the point (0, 0) in the glyph coordinate system. Tj and other
text-showing operators position the origin of the first glyph to be painted at the
origin of text space. For example, the following code adjusts the origin of text
Previous Next