Class TextState

java.lang.Object
com.datalogics.PDFL.TextState

public class TextState extends Object
The text state includes parameters that affect text. These parameters include character and word spacing, font, font size, and horizontal scale.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a default text state
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    double
    The current character spacing (corresponding to the Tc operator), in unscaled text space units.
    double
    The current font size (corresponding to the Tf operator).
    double
    The current horizontal scaling (corresponding to the Tz operator), as a percentage of the normal glyph width.
    The current text rendering mode (corresponding to the Tr operator).
    double
    The current text rise (corresponding to the Ts operator), in unscaled text space units.
    double
    The current word spacing (corresponding to the Tw operator), in unscaled text space units.
    void
    The current character spacing (corresponding to the Tc operator), in unscaled text space units.
    void
    setFontSize(double Tf)
    The current font size (corresponding to the Tf operator).
    void
    setHScale(double Tz)
    The current horizontal scaling (corresponding to the Tz operator), as a percentage of the normal glyph width.
    void
    The current text rendering mode (corresponding to the Tr operator).
    void
    setTextRise(double Ts)
    The current text rise (corresponding to the Ts operator), in unscaled text space units.
    void
    setWordSpacing(double Tw)
    The current word spacing (corresponding to the Tw operator), in unscaled text space units.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TextState

      public TextState()
      Create a default text state
  • Method Details

    • delete

      public void delete()
    • getRenderMode

      public TextRenderMode getRenderMode()
      The current text rendering mode (corresponding to the Tr operator).
    • setRenderMode

      public void setRenderMode(TextRenderMode Tr)
      The current text rendering mode (corresponding to the Tr operator).

      Parameters:
      Tr - the new/updated text rendering mode
    • getCharacterSpacing

      public double getCharacterSpacing()
      The current character spacing (corresponding to the Tc operator), in unscaled text space units.
    • setCharacterSpacing

      public void setCharacterSpacing(double Tc)
      The current character spacing (corresponding to the Tc operator), in unscaled text space units.

      Parameters:
      Tc - the new/updated character spacing
    • getWordSpacing

      public double getWordSpacing()
      The current word spacing (corresponding to the Tw operator), in unscaled text space units.
    • setWordSpacing

      public void setWordSpacing(double Tw)
      The current word spacing (corresponding to the Tw operator), in unscaled text space units.

      Parameters:
      Tw - the new/updated character spacing
    • getFontSize

      public double getFontSize()
      The current font size (corresponding to the Tf operator).
    • setFontSize

      public void setFontSize(double Tf)
      The current font size (corresponding to the Tf operator).
      Parameters:
      Tf - the new/updated font size
    • getHScale

      public double getHScale()
      The current horizontal scaling (corresponding to the Tz operator), as a percentage of the normal glyph width. Default is 100.
    • setHScale

      public void setHScale(double Tz)
      The current horizontal scaling (corresponding to the Tz operator), as a percentage of the normal glyph width. Default is 100.

      Parameters:
      Tz - the new/updated horizontal scaling
    • getTextRise

      public double getTextRise()
      The current text rise (corresponding to the Ts operator), in unscaled text space units.
    • setTextRise

      public void setTextRise(double Ts)
      The current text rise (corresponding to the Ts operator), in unscaled text space units.
      Parameters:
      Ts - the new/updated text rise