Class GlyphSubstitutionTableReader

java.lang.Object
com.itextpdf.io.font.otf.OpenTypeFontTableReader
com.itextpdf.io.font.otf.GlyphSubstitutionTableReader

public class GlyphSubstitutionTableReader extends OpenTypeFontTableReader
Parses an OpenTypeFont file and reads the Glyph Substitution Table. This table governs how two or more Glyphs should be merged to a single Glyph. This is especially useful for Asian languages like Bangla, Hindi, etc.

This has been written according to the OPenTypeFont specifications. See the OpenType GSUB table.

  • Constructor Details

    • GlyphSubstitutionTableReader

      public GlyphSubstitutionTableReader (RandomAccessFileOrArray rf, int gsubTableLocation, OpenTypeGdefTableReader gdef, Map<Integer,Glyph> indexGlyphMap, int unitsPerEm) throws IOException
      Instantiates a new instance of GlyphSubstitutionTableReader.
      Parameters:
      rf - the RandomAccessFileOrArray containing the OpenType font
      gsubTableLocation - the GSUB table location
      gdef - the GDEF table reader
      indexGlyphMap - the glyph index to glyph map
      unitsPerEm - the head.unitsPerEm value from the OpenType font
      Throws:
      IOException - exception is thrown in case an I/O error occurs when reading table
  • Method Details

    • readLookupTable

      protected OpenTableLookup readLookupTable (int lookupType, int lookupFlag, int[] subTableLocations) throws IOException
      Reads the lookup table from OpenType data.
      Specified by:
      readLookupTable in class OpenTypeFontTableReader
      Parameters:
      lookupType - the lookup type
      lookupFlag - specifies processing options, e.g. whether to skip base glyphs, marks or ligatures during glyph substitution or positioning. See Lookup table
      subTableLocations - the sub table locations
      Returns:
      the lookup table
      Throws:
      IOException - if the OpenType data cannot be read