Package com.itextpdf.io.font.otf
Class OpenTypeFontTableReader
- java.lang.Object
-
- com.itextpdf.io.font.otf.OpenTypeFontTableReader
-
- Direct Known Subclasses:
GlyphPositioningTableReader,GlyphSubstitutionTableReader
public abstract class OpenTypeFontTableReader extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected OpenTypeFeaturefeaturesTypeprivate OpenTypeGdefTableReadergdefprivate java.util.Map<java.lang.Integer,Glyph>indexGlyphMapprotected java.util.List<OpenTableLookup>lookupListprotected RandomAccessFileOrArrayrfprotected OpenTypeScriptscriptsTypeprotected inttableLocationprivate intunitsPerEm
-
Constructor Summary
Constructors Modifier Constructor Description protectedOpenTypeFontTableReader(RandomAccessFileOrArray rf, int tableLocation, OpenTypeGdefTableReader gdef, java.util.Map<java.lang.Integer,Glyph> indexGlyphMap, int unitsPerEm)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.List<FeatureRecord>getFeatureRecords()java.util.List<FeatureRecord>getFeatures(java.lang.String[] scripts, java.lang.String language)GlyphgetGlyph(int index)intgetGlyphClass(int glyphCode)LanguageRecordgetLanguageRecord(java.lang.String otfScriptTag)LanguageRecordgetLanguageRecord(java.lang.String otfScriptTag, java.lang.String langTag)java.util.List<OpenTableLookup>getLookups(FeatureRecord feature)java.util.List<OpenTableLookup>getLookups(FeatureRecord[] features)OpenTableLookupgetLookupTable(int idx)FeatureRecordgetRequiredFeature(java.lang.String[] scripts, java.lang.String language)java.util.List<ScriptRecord>getScriptRecords()java.util.List<FeatureRecord>getSpecificFeatures(java.util.List<FeatureRecord> features, java.lang.String[] specific)intgetUnitsPerEm()booleanisSkip(int glyph, int flag)protected OtfClassreadClassDefinition(int classLocation)protected java.util.List<java.lang.Integer>readCoverageFormat(int coverageLocation)protected voidreadCoverages(int[] locations, java.util.List<java.util.Set<java.lang.Integer>> coverage)private voidreadLookupListTable(int lookupListTableLocation)private voidreadLookupTable(int lookupTableLocation)protected abstract OpenTableLookupreadLookupTable(int lookupType, int lookupFlag, int[] subTableLocations)protected PosLookupRecord[]readPosLookupRecords(int substCount)protected SubstLookupRecord[]readSubstLookupRecords(int substCount)protected TagAndLocation[]readTagAndLocations(int baseLocation)protected int[]readUShortArray(int size)protected int[]readUShortArray(int size, int location)(package private) voidstartReadingTable()This is the starting point of the class.
-
-
-
Field Detail
-
rf
protected final RandomAccessFileOrArray rf
-
tableLocation
protected final int tableLocation
-
lookupList
protected java.util.List<OpenTableLookup> lookupList
-
scriptsType
protected OpenTypeScript scriptsType
-
featuresType
protected OpenTypeFeature featuresType
-
indexGlyphMap
private final java.util.Map<java.lang.Integer,Glyph> indexGlyphMap
-
gdef
private final OpenTypeGdefTableReader gdef
-
unitsPerEm
private final int unitsPerEm
-
-
Constructor Detail
-
OpenTypeFontTableReader
protected OpenTypeFontTableReader(RandomAccessFileOrArray rf, int tableLocation, OpenTypeGdefTableReader gdef, java.util.Map<java.lang.Integer,Glyph> indexGlyphMap, int unitsPerEm)
-
-
Method Detail
-
getGlyph
public Glyph getGlyph(int index)
-
getLookupTable
public OpenTableLookup getLookupTable(int idx)
-
getScriptRecords
public java.util.List<ScriptRecord> getScriptRecords()
-
getFeatureRecords
public java.util.List<FeatureRecord> getFeatureRecords()
-
getFeatures
public java.util.List<FeatureRecord> getFeatures(java.lang.String[] scripts, java.lang.String language)
-
getSpecificFeatures
public java.util.List<FeatureRecord> getSpecificFeatures(java.util.List<FeatureRecord> features, java.lang.String[] specific)
-
getRequiredFeature
public FeatureRecord getRequiredFeature(java.lang.String[] scripts, java.lang.String language)
-
getLookups
public java.util.List<OpenTableLookup> getLookups(FeatureRecord[] features)
-
getLookups
public java.util.List<OpenTableLookup> getLookups(FeatureRecord feature)
-
isSkip
public boolean isSkip(int glyph, int flag)
-
getGlyphClass
public int getGlyphClass(int glyphCode)
-
getUnitsPerEm
public int getUnitsPerEm()
-
getLanguageRecord
public LanguageRecord getLanguageRecord(java.lang.String otfScriptTag)
-
getLanguageRecord
public LanguageRecord getLanguageRecord(java.lang.String otfScriptTag, java.lang.String langTag)
-
readLookupTable
protected abstract OpenTableLookup readLookupTable(int lookupType, int lookupFlag, int[] subTableLocations) throws java.io.IOException
- Throws:
java.io.IOException
-
readClassDefinition
protected final OtfClass readClassDefinition(int classLocation)
-
readUShortArray
protected final int[] readUShortArray(int size, int location) throws java.io.IOException- Throws:
java.io.IOException
-
readUShortArray
protected final int[] readUShortArray(int size) throws java.io.IOException- Throws:
java.io.IOException
-
readCoverages
protected void readCoverages(int[] locations, java.util.List<java.util.Set<java.lang.Integer>> coverage) throws java.io.IOException- Throws:
java.io.IOException
-
readCoverageFormat
protected final java.util.List<java.lang.Integer> readCoverageFormat(int coverageLocation) throws java.io.IOException- Throws:
java.io.IOException
-
readSubstLookupRecords
protected SubstLookupRecord[] readSubstLookupRecords(int substCount) throws java.io.IOException
- Throws:
java.io.IOException
-
readPosLookupRecords
protected PosLookupRecord[] readPosLookupRecords(int substCount) throws java.io.IOException
- Throws:
java.io.IOException
-
readTagAndLocations
protected TagAndLocation[] readTagAndLocations(int baseLocation) throws java.io.IOException
- Throws:
java.io.IOException
-
startReadingTable
final void startReadingTable() throws FontReadingExceptionThis is the starting point of the class. A sub-class must call this method to start getting call backs to thereadLookupTable(int, int, int[])method.- Throws:
FontReadingException
-
readLookupListTable
private void readLookupListTable(int lookupListTableLocation) throws java.io.IOException- Throws:
java.io.IOException
-
readLookupTable
private void readLookupTable(int lookupTableLocation) throws java.io.IOException- Throws:
java.io.IOException
-
-