Previous Next


                                         390
CHAPTER 5                                                                         Text



Example 5.2

   /Resources
      << /Font << /F13 23 0 R >>
      >>
   23 0 obj
      << /Type /Font
          /Subtype /Type1
          /BaseFont /Helvetica
      >>
   endobj

A font defines the glyphs for one standard size. This standard is arranged so that
the nominal height of tightly spaced lines of text is 1 unit. In the default user
coordinate system, this means the standard glyph size is 1 unit in user space, or
1 ⁄ 72 inch. (In PDF 1.6, the size of this unit may be specified as greater than 1 ⁄ 72
inch by means of the UserUnit entry of the page dictionary; see Table 3.27.) The
standard-size font must then be scaled to be usable. The scale factor is specified
as the second operand of the Tf operator, thereby setting the text font size param-
eter in the graphics state. Example 5.1 establishes the Helvetica font with a 12-
unit size in the graphics state.

Once the font has been selected and scaled, it can be used to paint glyphs. The Td
operator adjusts the current text position (actually, the translation components of
the text matrix, as described in Section 5.3.1, “Text-Positioning Operators”).
When executed for the first time after BT, Td establishes the text position in the
current user coordinate system. This determines the position on the page at
which to begin painting glyphs.

The Tj operator takes a string operand and paints the corresponding glyphs, us-
ing the current font and other text-related parameters in the graphics state. In Ex-
ample 5.1, the Tj operator treats each element of the string (an integer in the
range 0 to 255) as a character code. Each code selects a glyph description in the
font, and the glyph description is executed to paint that glyph on the page. This is
the behavior of Tj for simple fonts, such as ordinary Latin text fonts. Interpreta-
tion of the string as a sequence of character codes is more complex for composite
fonts, described in Section 5.6, “Composite Fonts.”

Note: What these steps produce on the page is not a 12-point glyph, but rather a
12-unit glyph, where the unit size is that of the text space at the time the glyphs are
rendered on the page. The actual size of the glyph is determined by the text matrix

Previous Next