org.fontbox.cmap
Class CMap
public class CMap
extends java.lang.Object
This class represents a CMap file.
- Ben Litchfield (ben@benlitchfield.com)
CMap() - Creates a new instance of CMap.
|
CMap
public CMap()
Creates a new instance of CMap.
addCodespaceRange
public void addCodespaceRange(CodespaceRange range)
This will add a codespace range.
range
- A single codespace range.
addMapping
public void addMapping(byte[] src,
String dest)
throws IOException
This will add a mapping.
src
- The src to the mapping.dest
- The dest to the mapping.
getCodeSpaceRanges
public List getCodeSpaceRanges()
Getter for property codeSpaceRanges.
- Value of property codeSpaceRanges.
hasOneByteMappings
public boolean hasOneByteMappings()
This will tell if this cmap has any one byte mappings.
- true If there are any one byte mappings, false otherwise.
hasTwoByteMappings
public boolean hasTwoByteMappings()
This will tell if this cmap has any two byte mappings.
- true If there are any two byte mappings, false otherwise.
lookup
public String lookup(byte[] code,
int offset,
int length)
This will perform a lookup into the map.
code
- The code used to lookup.offset
- The offset into the byte array.length
- The length of the data we are getting.
- The string that matches the lookup.