Graphics Programs Reference
In-Depth Information
The result is shown in
Figure 6-3
. This is the first time we've used multiple
Tj
operators
without starting a new line. Note that the
Tj
operator, having shown the text, sets the
text position to the end of the string which was just drawn.
Figure 6-3. Superscripting and subscripting with the text rise operator
Kerning and glyph adjustment
The
TJ
operator is an alternative to
Tj
for drawing a string with horizontal glyph ad-
justments. These typically occur when text is layed out in a word-processor or type-
setter, especially if the content is fully justified. The
TJ
operator is a convenient way to
encode this information without using dozens of operators for each line of text:
BT
/F0 72 Tf
90 TL
1 0 0 1 240 330 Tm
[(PJ WAYNE)] TJ T*
[(P)150(J )(W)150(A)80(YN)20(E)] TJ
ET
We have used
TJ
twice here; once to show the text as normal, and a second time in-
cluding manual kerns in the array passed to
TJ
. The result is illustrated in
Figure 6-4
.