CHAPTER 5
408
Text
OPERANDS
OPERATOR
DESCRIPTION
array
TJ
Show one or more text strings, allowing individual glyph positioning (see imple-
array
can be a string or a
number. If the element is a string, this operator shows the string. If it is a num-
ber, the operator adjusts the text position by that amount; that is, it translates the
text matrix,
T
m
. The number is expressed in thousandths of a unit of text space
(see Section 5.3.3, “Text Space Details,” and implementation note 59 in Appen-
subtracted
from the current horizontal or vertical coordi-
nate, depending on the writing mode. In the default coordinate system, a
positive adjustment has the effect of moving the next glyph painted either to the
left or down by the given amount. Figure 5.11 shows an example of the effect of
passing offsets to
TJ
.
[ (AWAY again) ] TJ
[ (A) 120 (W) 120 (A) 95 (Y again) ] TJ
AWAY again
AWAY again
FIGURE 5.11
Operation of the
TJ
operator in horizontal writing
Note:
The text-showing operators can appear only within text objects.
A string operand of a text-showing operator is interpreted as a sequence of char-
acter codes identifying the glyphs to be painted. With most font types, each byte
of the string is treated as a separate character code. The character code is then
looked up in the font’s encoding to select the glyph, as described in Section 5.5.5,
Beginning with PDF 1.2, a string may be shown in a composite font that uses
multiple-byte codes to select some of its glyphs. In that case, one or more consec-
utive bytes of the string are treated as a single character code. The code lengths
and the mappings from codes to glyphs are defined in a data structure called a
CMap,
described in
.”
The strings must conform to the syntax for string objects. When a string is writ-
ten by enclosing the data in parentheses, bytes whose values are the same as those