com.lowagie.text.pdf.parser

## Class TextRenderInfo

- java.lang.Object
- - com.lowagie.text.pdf.parser.TextRenderInfo

-     public class TextRenderInfo
      extends java.lang.Object

  Provides information and calculations needed by render listeners to display/evaluate text render operations.
  This is passed between the `PdfContentStreamProcessor` and `RenderListener` objects as text rendering operations are discovered

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private GraphicsState` | `gs`
    `private java.lang.String` | `text`
    `private Matrix` | `textToUserSpaceTransformMatrix`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TextRenderInfo(java.lang.String text, GraphicsState gs, Matrix textMatrix)` Creates a new TextRenderInfo object

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Vector` | `getEndPoint()`
    `float` | `getSingleSpaceWidth()`
    `Vector` | `getStartPoint()`
    `private float` | `getStringWidth(java.lang.String string)` Gets the width of a String in text space units
    `java.lang.String` | `getText()`
    `private float` | `getUnscaledFontSpaceWidth()` Calculates the width of a space character.
    `float` | `getUnscaledWidth()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### text

          private final java.lang.String text

    - #### textToUserSpaceTransformMatrix

          private final Matrix textToUserSpaceTransformMatrix

    - #### gs

          private final GraphicsState gs

  - ### Constructor Detail

    - #### TextRenderInfo

          TextRenderInfo(java.lang.String text,
                        GraphicsState gs,
                        Matrix textMatrix)

      Creates a new TextRenderInfo object
      Parameters:
        `text` - the text that should be displayed
        `gs` - the graphics state (note: at this time, this is not immutable, so don't cache it)
        `textMatrix` - the text matrix at the time of the render operation

  - ### Method Detail

    - #### getText

          public java.lang.String getText()

      Returns:
        the text to render

    - #### getUnscaledWidth

          public float getUnscaledWidth()

      Returns:
        the unscaled (i.e. in Text space) width of the text

    - #### getStartPoint

          public Vector getStartPoint()

      Returns:
        a vector in User space representing the start point of the text

    - #### getEndPoint

          public Vector getEndPoint()

      Returns:
        a vector in User space representing the end point of the text (i.e. the starting point of the text plus the width of the text, transformed by the applicable transformation matrices)

    - #### getSingleSpaceWidth

          public float getSingleSpaceWidth()

      Returns:
        The width, in user space units, of a single space character in the current font

    - #### getUnscaledFontSpaceWidth

          private float getUnscaledFontSpaceWidth()

      Calculates the width of a space character. If the font does not define a width for a standard space character , we also attempt to use the width of (a non-breaking space in many fonts)
      Returns:
        the width of a single space character in text space units

    - #### getStringWidth

          private float getStringWidth(java.lang.String string)

      Gets the width of a String in text space units
      Parameters:
        `string` - the string that needs measuring
      Returns:
        the width of a String in text space units