Package com.itextpdf.io.font.otf
Class GlyphSubstitutionTableReader
java.lang.Object
com.itextpdf.io.font.otf.OpenTypeFontTableReader
com.itextpdf.io.font.otf.GlyphSubstitutionTableReader
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.
-
Field Summary
Fields inherited from class com.itextpdf.io.font.otf.OpenTypeFontTableReader
featuresType, lookupList, rf, scriptsType, tableLocation -
Constructor Summary
ConstructorsConstructorDescriptionGlyphSubstitutionTableReader(RandomAccessFileOrArray rf, int gsubTableLocation, OpenTypeGdefTableReader gdef, Map<Integer, Glyph> indexGlyphMap, int unitsPerEm) Instantiates a new instance ofGlyphSubstitutionTableReader. -
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
-
GlyphSubstitutionTableReader
public GlyphSubstitutionTableReader(RandomAccessFileOrArray rf, int gsubTableLocation, OpenTypeGdefTableReader gdef, Map<Integer, Glyph> indexGlyphMap, int unitsPerEm) throws IOExceptionInstantiates a new instance ofGlyphSubstitutionTableReader.- Parameters:
-
rf- theRandomAccessFileOrArraycontaining the OpenType font -
gsubTableLocation- the GSUB 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
-