Package com.tom_roush.fontbox.ttf
Class CmapSubtable
- java.lang.Object
-
- com.tom_roush.fontbox.ttf.CmapSubtable
-
public class CmapSubtable extends Object
A "cmap" subtable.
-
-
Constructor Summary
Constructors Constructor Description CmapSubtable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetCharacterCode(int gid)Returns the character code for the given GID, or null if there is none.intgetGlyphId(int characterCode)Returns the GlyphId linked with the given character code.intgetPlatformEncodingId()intgetPlatformId()voidinitData(com.tom_roush.fontbox.ttf.TTFDataStream data)This will read the required data from the stream.voidinitSubtable(CmapTable cmap, int numGlyphs, com.tom_roush.fontbox.ttf.TTFDataStream data)This will read the required data from the stream.protected voidprocessSubtype0(com.tom_roush.fontbox.ttf.TTFDataStream data)Initialize the CMapEntry when it is a subtype 0.protected voidprocessSubtype10(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs)Reads a format 10 subtable.protected voidprocessSubtype12(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs)Reads a format 12 subtable.protected voidprocessSubtype13(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs)Reads a format 13 subtable.protected voidprocessSubtype14(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs)Reads a format 14 subtable.protected voidprocessSubtype2(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs)Read a format 2 subtable.protected voidprocessSubtype4(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs)Reads a format 4 subtable.protected voidprocessSubtype6(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs)Reads a format 6 subtable.protected voidprocessSubtype8(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs)Reads a format 8 subtable.voidsetPlatformEncodingId(int platformEncodingIdValue)voidsetPlatformId(int platformIdValue)StringtoString()
-
-
-
Method Detail
-
initData
public void initData(com.tom_roush.fontbox.ttf.TTFDataStream data) throws IOExceptionThis will read the required data from the stream.- Parameters:
data- The stream to read the data from.- Throws:
IOException- If there is an error reading the data.
-
initSubtable
public void initSubtable(CmapTable cmap, int numGlyphs, com.tom_roush.fontbox.ttf.TTFDataStream data) throws IOException
This will read the required data from the stream.- Parameters:
cmap- the CMAP this encoding belongs to.numGlyphs- number of glyphs.data- The stream to read the data from.- Throws:
IOException- If there is an error reading the data.
-
processSubtype8
protected void processSubtype8(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs) throws IOExceptionReads a format 8 subtable.- Parameters:
data- the data stream of the to be parsed ttf fontnumGlyphs- number of glyphs to be read- Throws:
IOException- If there is an error parsing the true type font.
-
processSubtype10
protected void processSubtype10(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs) throws IOExceptionReads a format 10 subtable.- Parameters:
data- the data stream of the to be parsed ttf fontnumGlyphs- number of glyphs to be read- Throws:
IOException- If there is an error parsing the true type font.
-
processSubtype12
protected void processSubtype12(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs) throws IOExceptionReads a format 12 subtable.- Parameters:
data- the data stream of the to be parsed ttf fontnumGlyphs- number of glyphs to be read- Throws:
IOException- If there is an error parsing the true type font.
-
processSubtype13
protected void processSubtype13(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs) throws IOExceptionReads a format 13 subtable.- Parameters:
data- the data stream of the to be parsed ttf fontnumGlyphs- number of glyphs to be read- Throws:
IOException- If there is an error parsing the true type font.
-
processSubtype14
protected void processSubtype14(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs) throws IOExceptionReads a format 14 subtable.- Parameters:
data- the data stream of the to be parsed ttf fontnumGlyphs- number of glyphs to be read- Throws:
IOException- If there is an error parsing the true type font.
-
processSubtype6
protected void processSubtype6(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs) throws IOExceptionReads a format 6 subtable.- Parameters:
data- the data stream of the to be parsed ttf fontnumGlyphs- number of glyphs to be read- Throws:
IOException- If there is an error parsing the true type font.
-
processSubtype4
protected void processSubtype4(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs) throws IOExceptionReads a format 4 subtable.- Parameters:
data- the data stream of the to be parsed ttf fontnumGlyphs- number of glyphs to be read- Throws:
IOException- If there is an error parsing the true type font.
-
processSubtype2
protected void processSubtype2(com.tom_roush.fontbox.ttf.TTFDataStream data, int numGlyphs) throws IOExceptionRead a format 2 subtable.- Parameters:
data- the data stream of the to be parsed ttf fontnumGlyphs- number of glyphs to be read- Throws:
IOException- If there is an error parsing the true type font.
-
processSubtype0
protected void processSubtype0(com.tom_roush.fontbox.ttf.TTFDataStream data) throws IOExceptionInitialize the CMapEntry when it is a subtype 0.- Parameters:
data- the data stream of the to be parsed ttf font- Throws:
IOException- If there is an error parsing the true type font.
-
getPlatformEncodingId
public int getPlatformEncodingId()
- Returns:
- Returns the platformEncodingId.
-
setPlatformEncodingId
public void setPlatformEncodingId(int platformEncodingIdValue)
- Parameters:
platformEncodingIdValue- The platformEncodingId to set.
-
getPlatformId
public int getPlatformId()
- Returns:
- Returns the platformId.
-
setPlatformId
public void setPlatformId(int platformIdValue)
- Parameters:
platformIdValue- The platformId to set.
-
getGlyphId
public int getGlyphId(int characterCode)
Returns the GlyphId linked with the given character code.- Parameters:
characterCode- the given character code to be mapped- Returns:
- glyphId the corresponding glyph id for the given character code
-
getCharacterCode
public Integer getCharacterCode(int gid)
Returns the character code for the given GID, or null if there is none.- Parameters:
gid- glyph id- Returns:
- character code
-
-