Class OpenTableLookup

java.lang.Object
com.itextpdf.io.font.otf.OpenTableLookup
Direct Known Subclasses:
GposLookupType1, GposLookupType2, GposLookupType4, GposLookupType5, GposLookupType6, GposLookupType7, GsubLookupType1, GsubLookupType2, GsubLookupType3, GsubLookupType4, GsubLookupType5

public abstract class OpenTableLookup extends Object
A Lookup table defines the specific conditions, type, and results of substitution or positioning actions that are used to implement a feature.

The data describing the actions of a lookup are contained in one or more lookup subtables. Different lookup types support different types of operation; for example, positioning adjustment on a single glyph versus positioning adjustments on pairs of glyphs.

For more information see Lookup table

  • Field Details

    • lookupFlag

      protected int lookupFlag
      Indicates to a text-processing client certain processing options to use when substituting or positioning glyphs.
    • subTableLocations

      protected int[] subTableLocations
      Subtables locations.
    • openReader

      protected OpenTypeFontTableReader openReader
      OpenType font table reader.
  • Constructor Details

    • OpenTableLookup

      protected OpenTableLookup (OpenTypeFontTableReader openReader, int lookupFlag, int[] subTableLocations)
      Instantiates a new instance of OpenTableLookup.
      Parameters:
      openReader - the OpenType font table reader
      lookupFlag - the lookup flag
      subTableLocations - the subtables locations
  • Method Details

    • getLookupFlag

      public int getLookupFlag()
      Gets the lookup flag.

      The flag indicates to a text-processing client certain processing options to use when substituting or positioning glyphs.

      Returns:
      the lookup flag
    • transformOne

      public abstract boolean transformOne (GlyphLine line)
      Apply transformation to only one glyph from the glyph line.
      Parameters:
      line - the glyph line to transform
      Returns:
      true if transformation was applied, false otherwise
    • transformLine

      public boolean transformLine (GlyphLine line)
      Apply transformation to the glyph line.
      Parameters:
      line - the glyph line to transform
      Returns:
      true if transformation was applied, false otherwise
    • hasSubstitution

      public boolean hasSubstitution (int index)
      Checks whether there is a substitution (replacement) for the specified index in this lookup table.
      Parameters:
      index - the index to check for a substitution
      Returns:
      true if there is substitution, false otherwise
    • readSubTables

      protected void readSubTables() throws IOException
      Reads subtables.
      Throws:
      IOException - exception is thrown in case an I/O error occurs when reading subtables
    • readSubTable

      protected abstract void readSubTable (int subTableLocation) throws IOException
      Reads subtable from the specified location.
      Parameters:
      subTableLocation - the subtable location
      Throws:
      IOException - exception is thrown in case an I/O error occurs when reading subtable
    • getIndexInLookupList

      public int getIndexInLookupList()
      Gets this lookup table index in the LookupList.
      Returns:
      the table index in the LookupList
    • setIndexInLookupList

      public void setIndexInLookupList (int indexInLookupList)
      Sets lookup table index in the LookupList.
      Parameters:
      indexInLookupList - the table index in the LookupList