Previous Next


                                                   410
    CHAPTER 5                                                                      Text



    Trm is a temporary matrix; conceptually, it is recomputed before each glyph is
    painted during a text-showing operation.

    After the glyph is painted, the text matrix is updated according to the glyph dis-
    placement and any spacing parameters that apply. First, a combined displacement
    is computed, denoted by tx in horizontal writing mode or ty in vertical writing
    mode (the variable corresponding to the other writing mode is set to 0):
                      Tj
    t x = ⎛ ⎛ w0 – ---------- ⎞ × T fs + T c + T w ⎞ × T h
                            -
          ⎝⎝       1000 ⎠                          ⎠
                    Tj
    t y = ⎛ w1 – ---------- ⎞ × T fs + T c + T w
                          -
          ⎝      1000 ⎠

    where
      w0 and w1 are the glyph’s horizontal and vertical displacements
      Tj is a position adjustment specified by a number in a TJ array, if any
      Tfs and Th are the current text font size and horizontal scaling parameters in the
      graphics state
      Tc and Tw are the current character- and word-spacing parameters in the
      graphics state, if applicable

    The text matrix is then updated as follows:

               1    0 0
    Tm =       0    1 0      × Tm
               tx   ty 1


5.4 Introduction to Font Data Structures

    A font is represented in PDF as a dictionary specifying the type of font, its Post-
    Script name, its encoding, and information that can be used to provide a substi-
    tute when the font program is not available. Optionally, the font program can be
    embedded as a stream object in the PDF file.

    The font types are distinguished by the Subtype entry in the font dictionary.
    Table 5.7 lists the font types defined in PDF. Type 0 fonts are called composite
    fonts; other types of fonts are called simple fonts. In addition to fonts, PDF sup-

Previous Next