Previous Next


                                         422
CHAPTER 5                                                                        Text



For each character code shown by a text-showing operator that uses a Type 3 font,
the consumer application does the following:

1. Looks up the character code in the font’s Encoding entry, as described in Sec-
   tion 5.5.5, “Character Encoding,” to obtain a character name.
2. Looks up the character name in the font’s CharProcs dictionary to obtain a
   stream object containing a glyph description. (If the name is not present as a
   key in CharProcs, no glyph is painted.)
3. Invokes the glyph description, as described below. The graphics state is saved
   before this invocation and restored afterward; therefore, any changes the glyph
   description makes to the graphics state do not persist after it finishes.

When the glyph description begins execution, the current transformation matrix
(CTM) is the concatenation of the font matrix (FontMatrix in the current font
dictionary) and the text space that was in effect at the time the text-showing op-
erator was invoked (see Section 5.3.3, “Text Space Details”). This means that
shapes described in the glyph coordinate system are transformed into the user
coordinate system and appear in the appropriate size and orientation on the page.
The glyph description should describe the glyph in terms of absolute coordinates
in the glyph coordinate system, placing the glyph origin at (0, 0) in this space. It
should make no assumptions about the initial text position.

Aside from the CTM, the graphics state is inherited from the environment of the
text-showing operator that caused the glyph description to be invoked. To ensure
predictable results, the glyph description must initialize any graphics state
parameters on which it depends. In particular, if it invokes the S (stroke) opera-
tor, it should explicitly set the line width, line join, line cap, and dash pattern to
appropriate values. Normally, it is unnecessary and undesirable to initialize the
current color parameter because the text-showing operators are designed to paint
glyphs with the current color.

The glyph description must execute one of the operators described in Table 5.10
to pass width and bounding box information to the font machinery. This must
precede the execution of any path construction or path-painting operators de-
scribing the glyph.

Note: Type 3 fonts in PDF are very similar to those in PostScript. Some of the in-
formation provided in Type 3 font dictionaries and glyph descriptions, while seem-
ingly redundant or unnecessary, is nevertheless required for correct results when a

Previous Next