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 OpenTypeFeature
featuresType
private OpenTypeGdefTableReader
gdef
private java.util.Map<java.lang.Integer,Glyph>
indexGlyphMap
protected java.util.List<OpenTableLookup>
lookupList
protected RandomAccessFileOrArray
rf
protected OpenTypeScript
scriptsType
protected int
tableLocation
private int
unitsPerEm
-
Constructor Summary
Constructors Modifier Constructor Description protected
OpenTypeFontTableReader(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)
Glyph
getGlyph(int index)
int
getGlyphClass(int glyphCode)
LanguageRecord
getLanguageRecord(java.lang.String otfScriptTag)
LanguageRecord
getLanguageRecord(java.lang.String otfScriptTag, java.lang.String langTag)
java.util.List<OpenTableLookup>
getLookups(FeatureRecord feature)
java.util.List<OpenTableLookup>
getLookups(FeatureRecord[] features)
OpenTableLookup
getLookupTable(int idx)
FeatureRecord
getRequiredFeature(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)
int
getUnitsPerEm()
boolean
isSkip(int glyph, int flag)
protected OtfClass
readClassDefinition(int classLocation)
protected java.util.List<java.lang.Integer>
readCoverageFormat(int coverageLocation)
protected void
readCoverages(int[] locations, java.util.List<java.util.Set<java.lang.Integer>> coverage)
private void
readLookupListTable(int lookupListTableLocation)
private void
readLookupTable(int lookupTableLocation)
protected abstract OpenTableLookup
readLookupTable(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) void
startReadingTable()
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 FontReadingException
This 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
-
-