Class TextColorInfo

java.lang.Object
com.itextpdf.kernel.contrast.ColorInfo
com.itextpdf.kernel.contrast.TextColorInfo

public class TextColorInfo extends ColorInfo
Represents rendering information for a text element in contrast analysis.
  • Constructor Details

    • TextColorInfo

      public TextColorInfo (String text, String parent, Color color, Path path, float fontSize)
      Constructs a new TextColorInfo with the specified text properties.
      Parameters:
      text - the text content (typically a single character) being rendered
      parent - the parent text string that this text is part of, providing context
      color - the fill color of the text
      path - the geometric path defining the shape and position of the text element
      fontSize - the font size in points.
  • Method Details

    • getText

      public String getText()
      Gets the text content being rendered.

      This typically represents a single character or glyph from the PDF content stream.

      Returns:
      the text content as a String
    • getParent

      public String getParent()
      Gets the parent text string that this text is part of.

      This provides context about the larger text block or string that contains this individual text element, which can be useful for debugging and analysis.

      Returns:
      the parent text string
    • getFontSize

      public float getFontSize()
      Gets the font size of the text in points.
      Returns:
      the font size in points
    • toString

      public String toString()
      Returns a string representation of this text render information.
      Overrides:
      toString in class Object
      Returns:
      a string containing the text, parent, color, and path information