Package com.sun.pdfview.font.ttf
Class CMap
- java.lang.Object
-
- com.sun.pdfview.font.ttf.CMap
-
- Direct Known Subclasses:
CMapFormat0,CMapFormat4,CMapFormat6
public abstract class CMap extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCMap(short format, short language)Creates a new instance of CMap Don't use this directly, useCMap.createMap()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static CMapcreateMap(short format, short language)Create a map for the given format and languageabstract java.nio.ByteBuffergetData()Get the data in this map as a byte buffershortgetFormat()Get the format of this mapshortgetLanguage()Get the language of this mapabstract shortgetLength()Get the length of this mapstatic CMapgetMap(java.nio.ByteBuffer data)Get a map from the given data This method reads the format, data and length variables of the map.abstract bytemap(byte src)Map an 8 bit value to another 8 bit valueabstract charmap(char src)Map a 16 bit value to another 16 but valueabstract charreverseMap(short glyphID)Get the src code which maps to the given glyphIDabstract voidsetData(int length, java.nio.ByteBuffer data)Set the data for this mapjava.lang.StringtoString()Print a pretty string
-
-
-
Method Detail
-
createMap
public static CMap createMap(short format, short language)
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:
http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6cmap.html
-
getMap
public static CMap getMap(java.nio.ByteBuffer data)
Get a map from the given data This method reads the format, data and length variables of the map.
-
getFormat
public short getFormat()
Get the format of this map
-
getLanguage
public short getLanguage()
Get the language of this map
-
setData
public abstract void setData(int length, java.nio.ByteBuffer data)Set the data for this map
-
getData
public abstract java.nio.ByteBuffer getData()
Get the data in this map as a byte buffer
-
getLength
public abstract short getLength()
Get the length of this map
-
map
public abstract byte map(byte src)
Map an 8 bit value to another 8 bit value
-
map
public abstract char map(char src)
Map a 16 bit value to another 16 but value
-
reverseMap
public abstract char reverseMap(short glyphID)
Get the src code which maps to the given glyphID
-
toString
public java.lang.String toString()
Print a pretty string- Overrides:
toStringin classjava.lang.Object
-
-