Graphics Programs Reference
In-Depth Information
Text State
The text state parameters and the operators which modify them are summarized in
Table 6-1
.
Table 6-1. Text state parameters and their operators
Parame-
ter
Description
Operands
Operators
Initial value
T
c
Character spacing
charSpace
Tc
sets the character spacing to
charSpace
,
expressed in unscaled text space units.
0
T
w
Word spacing
wordSpace
Tw
sets the word spacing to
wordSpace
,
expressed in unscaled text units.
0
T
h
Horizontal spacing
scale
Tz
sets the horizontal scaling to (
scale
/ 100).
100 (normal spacing)
T
l
Leading
leading
TL
sets the text leading to
leading
, expressed
in unscaled text space units.
0
T
f
, T
fs
Font, Font Size
font, size
Tf
selects the font
font
at size
size
points.
None. Must be specified.
T
mode
Rendering Mode
render
Tr
sets the text rendering mode to
render
, an
integer.
0
T
rise
Rise
rise
Ts
sets the text rise to
rise
, expressed in un-
scaled text space units.
0
We discuss the phrase “unscaled text space units” in
“Text Space and Text Position-
ing” on page 75
. The text state is stored along with the graphics state, and manipu-
lated using the operators above. The current text state is affected by the stack operators
q
and
Q
, just like the graphics state.
Printing Text
Printing text on the page requires:
1. Selecting a font.
2. Choosing position, size, and orientation.
3. Choosing spacing, color, text rendering mode, and other parameters.
4. Selecting characters from the font, and showing them on the page.
Text Sections
The operators
BT
(begin text) and
ET
(end text) form brackets around
text sections
.
Operators for showing text in a page's content stream may only appear between
BT
and
ET
. Operators for altering text state, however, are not restricted in this way. Text sec-
tions may also contain other operators altering the general graphics state.