Class CMap
java.lang.Object
org.loboevolution.pdfview.font.ttf.CMap
- Direct Known Subclasses:
CMapFormat0
,CMapFormat4
,CMapFormat6
Abstract CMap class.
Author jkaplan
-
Constructor Summary
ModifierConstructorDescriptionprotected
CMap
(short format, short language) Creates a new instance of CMap Don't use this directly, useCMap.createMap()
-
Method Summary
Modifier and TypeMethodDescriptionstatic CMap
createMap
(short format, short language) Create a map for the given format and languageabstract ByteBuffer
getData()
Get the data in this map as a byte bufferabstract short
Get the length of this mapstatic CMap
getMap
(ByteBuffer data) Get a map from the given dataabstract byte
map
(byte src) Map an 8 bit value to another 8 bit valueabstract char
map
(char src) Map a 16 bit value to another 16 but valueabstract char
reverseMap
(short glyphID) Get the src code which maps to the given glyphIDabstract void
setData
(int length, ByteBuffer data) Set the data for this maptoString()
-
Constructor Details
-
CMap
protected CMap(short format, short language) Creates a new instance of CMap Don't use this directly, useCMap.createMap()
- Parameters:
format
- a short.language
- a short.
-
-
Method Details
-
createMap
Create a map for the given format and languageThe Macintosh standard character to glyph mapping is supported by format 0.
Format 2 supports a mixed 8/16 bit mapping useful for Japanese, Chinese and Korean.
Format 4 is used for 16 bit mappings.
Format 6 is used for dense 16 bit mappings.
Formats 8, 10, and 12 (properly 8.0, 10.0, and 12.0) are used for mixed 16/32-bit and pure 32-bit mappings.
This supports text encoded with surrogates in Unicode 2.0 and later.Reference:
...- Parameters:
format
- a short.language
- a short.- Returns:
- a
CMap
object.
-
getMap
Get a map from the given dataThis method reads the format, data and length variables of the map.
- Parameters:
data
- aByteBuffer
object.- Returns:
- a
CMap
object.
-
setData
Set the data for this map- Parameters:
length
- aInteger
object.data
- aByteBuffer
object.
-
getData
Get the data in this map as a byte buffer- Returns:
- a
ByteBuffer
object.
-
getLength
public abstract short getLength()Get the length of this map- Returns:
- a short.
-
map
public abstract byte map(byte src) Map an 8 bit value to another 8 bit value- Parameters:
src
- a byte.- Returns:
- a byte.
-
map
public abstract char map(char src) Map a 16 bit value to another 16 but value- Parameters:
src
- a char.- Returns:
- a char.
-
reverseMap
public abstract char reverseMap(short glyphID) Get the src code which maps to the given glyphID- Parameters:
glyphID
- a short.- Returns:
- a char.
-
toString
Print a pretty string
-