org.apache.fontbox.ttf
Class CMAPEncodingEntry

java.lang.Object
  extended by org.apache.fontbox.ttf.CMAPEncodingEntry

public class CMAPEncodingEntry
extends java.lang.Object

An encoding entry for a cmap.

Version:
$Revision: 1.2 $
Author:
Ben Litchfield

Constructor Summary
CMAPEncodingEntry()
           
 
Method Summary
 int getGlyphId(int characterCode)
          Returns the GlyphId linked with the given character code.
 int[] getGlyphIdToCharacterCode()
           
 int getPlatformEncodingId()
           
 int getPlatformId()
           
 void initData(TrueTypeFont ttf, TTFDataStream data)
          This will read the required data from the stream.
 void initSubtable(TrueTypeFont ttf, TTFDataStream data)
          This will read the required data from the stream.
protected  void processSubtype0(TrueTypeFont ttf, TTFDataStream data)
          Initialize the CMapEntry when it is a subtype 0
protected  void processSubtype10(TrueTypeFont ttf, TTFDataStream data, int numGlyphs)
          Reads a format 10 subtable.
protected  void processSubtype12(TrueTypeFont ttf, TTFDataStream data, int numGlyphs)
          Reads a format 12 subtable.
protected  void processSubtype13(TrueTypeFont ttf, TTFDataStream data, int numGlyphs)
          Reads a format 13 subtable.
protected  void processSubtype14(TrueTypeFont ttf, TTFDataStream data, int numGlyphs)
          Reads a format 14 subtable.
protected  void processSubtype2(TrueTypeFont ttf, TTFDataStream data, int numGlyphs)
          Read a format 2 subtable.
protected  void processSubtype4(TrueTypeFont ttf, TTFDataStream data, int numGlyphs)
          Reads a format 4 subtable.
protected  void processSubtype6(TrueTypeFont ttf, TTFDataStream data, int numGlyphs)
          Reads a format 6 subtable.
protected  void processSubtype8(TrueTypeFont ttf, TTFDataStream data, int numGlyphs)
          Reads a format 8 subtable.
 void setGlyphIdToCharacterCode(int[] glyphIdToCharacterCodeValue)
           
 void setPlatformEncodingId(int platformEncodingIdValue)
           
 void setPlatformId(int platformIdValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CMAPEncodingEntry

public CMAPEncodingEntry()
Method Detail

initData

public void initData(TrueTypeFont ttf,
                     TTFDataStream data)
              throws java.io.IOException
This will read the required data from the stream.

Parameters:
ttf - The font that is being read.
data - The stream to read the data from.
Throws:
java.io.IOException - If there is an error reading the data.

initSubtable

public void initSubtable(TrueTypeFont ttf,
                         TTFDataStream data)
                  throws java.io.IOException
This will read the required data from the stream.

Parameters:
ttf - The font that is being read.
data - The stream to read the data from.
Throws:
java.io.IOException - If there is an error reading the data.

processSubtype8

protected void processSubtype8(TrueTypeFont ttf,
                               TTFDataStream data,
                               int numGlyphs)
                        throws java.io.IOException
Reads a format 8 subtable.

Parameters:
ttf - the TrueTypeFont instance holding the parsed data.
data - the data stream of the to be parsed ttf font
numGlyphs - number of glyphs to be read
Throws:
java.io.IOException - If there is an error parsing the true type font.

processSubtype10

protected void processSubtype10(TrueTypeFont ttf,
                                TTFDataStream data,
                                int numGlyphs)
                         throws java.io.IOException
Reads a format 10 subtable.

Parameters:
ttf - the TrueTypeFont instance holding the parsed data.
data - the data stream of the to be parsed ttf font
numGlyphs - number of glyphs to be read
Throws:
java.io.IOException - If there is an error parsing the true type font.

processSubtype12

protected void processSubtype12(TrueTypeFont ttf,
                                TTFDataStream data,
                                int numGlyphs)
                         throws java.io.IOException
Reads a format 12 subtable.

Parameters:
ttf - the TrueTypeFont instance holding the parsed data.
data - the data stream of the to be parsed ttf font
numGlyphs - number of glyphs to be read
Throws:
java.io.IOException - If there is an error parsing the true type font.

processSubtype13

protected void processSubtype13(TrueTypeFont ttf,
                                TTFDataStream data,
                                int numGlyphs)
                         throws java.io.IOException
Reads a format 13 subtable.

Parameters:
ttf - the TrueTypeFont instance holding the parsed data.
data - the data stream of the to be parsed ttf font
numGlyphs - number of glyphs to be read
Throws:
java.io.IOException - If there is an error parsing the true type font.

processSubtype14

protected void processSubtype14(TrueTypeFont ttf,
                                TTFDataStream data,
                                int numGlyphs)
                         throws java.io.IOException
Reads a format 14 subtable.

Parameters:
ttf - the TrueTypeFont instance holding the parsed data.
data - the data stream of the to be parsed ttf font
numGlyphs - number of glyphs to be read
Throws:
java.io.IOException - If there is an error parsing the true type font.

processSubtype6

protected void processSubtype6(TrueTypeFont ttf,
                               TTFDataStream data,
                               int numGlyphs)
                        throws java.io.IOException
Reads a format 6 subtable.

Parameters:
ttf - the TrueTypeFont instance holding the parsed data.
data - the data stream of the to be parsed ttf font
numGlyphs - number of glyphs to be read
Throws:
java.io.IOException - If there is an error parsing the true type font.

processSubtype4

protected void processSubtype4(TrueTypeFont ttf,
                               TTFDataStream data,
                               int numGlyphs)
                        throws java.io.IOException
Reads a format 4 subtable.

Parameters:
ttf - the TrueTypeFont instance holding the parsed data.
data - the data stream of the to be parsed ttf font
numGlyphs - number of glyphs to be read
Throws:
java.io.IOException - If there is an error parsing the true type font.

processSubtype2

protected void processSubtype2(TrueTypeFont ttf,
                               TTFDataStream data,
                               int numGlyphs)
                        throws java.io.IOException
Read a format 2 subtable.

Parameters:
ttf - the TrueTypeFont instance holding the parsed data.
data - the data stream of the to be parsed ttf font
numGlyphs - number of glyphs to be read
Throws:
java.io.IOException - If there is an error parsing the true type font.

processSubtype0

protected void processSubtype0(TrueTypeFont ttf,
                               TTFDataStream data)
                        throws java.io.IOException
Initialize the CMapEntry when it is a subtype 0

Parameters:
ttf -
data -
Throws:
java.io.IOException

getGlyphIdToCharacterCode

public int[] getGlyphIdToCharacterCode()
Returns:
Returns the glyphIdToCharacterCode.

setGlyphIdToCharacterCode

public void setGlyphIdToCharacterCode(int[] glyphIdToCharacterCodeValue)
Parameters:
glyphIdToCharacterCodeValue - The glyphIdToCharacterCode to set.

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 -
Returns:
glyphId