Class GlyphPositioningTableReader

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

public class GlyphPositioningTableReader 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 GPOS table.

  • Constructor Details

    • GlyphPositioningTableReader

      public GlyphPositioningTableReader (RandomAccessFileOrArray rf, int gposTableLocation, OpenTypeGdefTableReader gdef, Map<Integer,Glyph> indexGlyphMap, int unitsPerEm) throws IOException
      Instantiates a new instance of GlyphPositioningTableReader.
      Parameters:
      rf - the RandomAccessFileOrArray containing the OpenType font
      gposTableLocation - the GPOS 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