Class GlyphLine

java.lang.Object
com.itextpdf.io.font.otf.GlyphLine

public class GlyphLine extends Object
Represents a mutable glyph sequence used during OpenType layout.
  • Field Details

  • Constructor Details

    • GlyphLine

      public GlyphLine()
      Creates a new empty line of Glyphs.
    • GlyphLine

      public GlyphLine (List<Glyph> glyphs)
      Create a new line of Glyphs.
      Parameters:
      glyphs - list containing the glyphs
    • GlyphLine

      public GlyphLine (List<Glyph> glyphs, int start, int end)
      Create a new line of Glyphs from a slice of a List of Glyphs.
      Parameters:
      glyphs - list of Glyphs to slice
      start - starting index of the slice
      end - terminating index of the slice
    • GlyphLine

      protected GlyphLine (List<Glyph> glyphs, List<GlyphLine.ActualText> actualText, int start, int end)
      Create a new line of Glyphs from a slice of a List of Glyphs, and add the actual text.
      Parameters:
      glyphs - list of Glyphs to slice
      actualText - corresponding list containing the actual text the glyphs represent
      start - starting index of the slice
      end - terminating index of the slice
    • GlyphLine

      public GlyphLine (GlyphLine other)
      Copy a line of Glyphs.
      Parameters:
      other - line of Glyphs to copy
    • GlyphLine

      public GlyphLine (GlyphLine other, int start, int end)
      Copy a slice of a line of Glyphs
      Parameters:
      other - line of Glyphs to copy
      start - starting index of the slice
      end - terminating index of the slice
  • Method Details

    • getStart

      public int getStart()
      Retrieves the start of the glyph line.
      Returns:
      start of glyph line
    • setStart

      public void setStart (int start)
      Sets the start of the glyph line.
      Parameters:
      start - start of glyph line
    • getEnd

      public int getEnd()
      Retrieves the end of the glyph line.
      Returns:
      end of glyph line
    • setEnd

      public void setEnd (int end)
      Sets the end of the glyph line.
      Parameters:
      end - end of glyph line
    • getIdx

      public int getIdx()
      Retrieves the idx of the glyph line.
      Returns:
      idx of glyph line
    • setIdx

      public void setIdx (int idx)
      Sets the idx of the glyph line.
      Parameters:
      idx - idx of glyph line
    • toUnicodeString

      public String toUnicodeString (int start, int end)
      Get the unicode string representation of the GlyphLine slice.
      Parameters:
      start - starting index of the slice
      end - terminating index of the slice
      Returns:
      String containing the unicode representation of the slice.
    • toString

      public String toString()
      Returns a string representation of this glyph.
      Overrides:
      toString in class Object
      Returns:
      the requested result
    • copy

      public GlyphLine copy (int left, int right)
      Copy a slice of this Glyphline.
      Parameters:
      left - leftmost index of the slice
      right - rightmost index of the slice
      Returns:
      new GlyphLine containing the copied slice
    • get

      public Glyph get (int index)
    • set

      public Glyph set (int index, Glyph glyph)
    • add

      public void add (Glyph glyph)
    • add

      public void add (int index, Glyph glyph)
    • setGlyphs

      public void setGlyphs (List<Glyph> replacementGlyphs)
      Updates the glyphs.
      Parameters:
      replacementGlyphs - the replacement glyphs
    • add

      public void add (GlyphLine other)
      Add a line to the current one. The glyphs from the start till the end points will be copied. The same is true for the actual text.
      Parameters:
      other - the line that should be added to the current one
    • replaceContent

      public void replaceContent (GlyphLine other)
      Replaces the current content with the other line's content.
      Parameters:
      other - the line with the content to be set to the current one
    • size

      public int size()
      Returns the number of glyphs in this line.
      Returns:
      the number of glyphs
    • substituteManyToOne

      public void substituteManyToOne (OpenTypeFontTableReader tableReader, int lookupFlag, int rightPartLen, int substitutionGlyphIndex)
      Applies the many-to-one glyph substitution.
      Parameters:
      tableReader - the table reader
      lookupFlag - specifies processing options, e.g. whether to skip base glyphs, marks or ligatures during glyph substitution or positioning. See Lookup table
      rightPartLen - the right part length
      substitutionGlyphIndex - the substitution glyph index
    • substituteOneToOne

      public void substituteOneToOne (OpenTypeFontTableReader tableReader, int substitutionGlyphIndex)
      Applies the one-to-one glyph substitution.
      Parameters:
      tableReader - the table reader
      substitutionGlyphIndex - the substitution glyph index
    • substituteOneToMany

      public void substituteOneToMany (OpenTypeFontTableReader tableReader, int[] substGlyphIds)
      Applies the one-to-many glyph substitution.
      Parameters:
      tableReader - the table reader
      substGlyphIds - the substitution glyph ids
    • filter

      public GlyphLine filter (GlyphLine.IGlyphLineFilter filter)
    • setActualText

      public void setActualText (int left, int right, String text)
      Updates the actual text.
      Parameters:
      left - the start index
      right - the end index
      text - the text
    • iterator

      public Iterator<GlyphLine.GlyphLinePart> iterator()
    • equals

      public boolean equals (Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object