Package com.itextpdf.io.font.otf
Class GlyphPositioningTableReader
java.lang.Object
com.itextpdf.io.font.otf.OpenTypeFontTableReader
com.itextpdf.io.font.otf.GlyphPositioningTableReader
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.
-
Field Summary
Fields inherited from class com.itextpdf.io.font.otf.OpenTypeFontTableReader
featuresType, lookupList, rf, scriptsType, tableLocation -
Constructor Summary
ConstructorsConstructorDescriptionGlyphPositioningTableReader(RandomAccessFileOrArray rf, int gposTableLocation, OpenTypeGdefTableReader gdef, Map<Integer, Glyph> indexGlyphMap, int unitsPerEm) Instantiates a new instance ofGlyphPositioningTableReader. -
Method Summary
Modifier and TypeMethodDescriptionprotected OpenTableLookupreadLookupTable(int lookupType, int lookupFlag, int[] subTableLocations) Reads the lookup table from OpenType data.Methods inherited from class com.itextpdf.io.font.otf.OpenTypeFontTableReader
getFeatureRecords, getFeatures, getGlyph, getGlyphClass, getLanguageRecord, getLanguageRecord, getLookups, getLookups, getLookupTable, getRequiredFeature, getScriptRecords, getSpecificFeatures, getUnitsPerEm, isSkip, readClassDefinition, readCoverageFormat, readCoverages, readPosLookupRecords, readSubstLookupRecords, readTagAndLocations, readUShortArray, readUShortArray
-
Constructor Details
-
GlyphPositioningTableReader
public GlyphPositioningTableReader(RandomAccessFileOrArray rf, int gposTableLocation, OpenTypeGdefTableReader gdef, Map<Integer, Glyph> indexGlyphMap, int unitsPerEm) throws IOExceptionInstantiates a new instance ofGlyphPositioningTableReader.- Parameters:
-
rf- theRandomAccessFileOrArraycontaining the OpenType font -
gposTableLocation- the GPOS table location -
gdef- the GDEF table reader -
indexGlyphMap- the glyph index to glyph map -
unitsPerEm- thehead.unitsPerEmvalue 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:
-
readLookupTablein classOpenTypeFontTableReader - 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
-