public class CMap extends Object
Constructor and Description |
---|
CMap()
Creates a new instance of CMap.
|
Modifier and Type | Method and Description |
---|---|
void |
addCIDMapping(int src,
String dest)
This will add a CID mapping.
|
void |
addCIDRange(char from,
char to,
int cid)
This will add a CID Range.
|
void |
addCodespaceRange(CodespaceRange range)
This will add a codespace range.
|
void |
addMapping(byte[] src,
String dest)
This will add a mapping.
|
List<CodespaceRange> |
getCodeSpaceRanges()
Getter for property codeSpaceRanges.
|
String |
getName()
Returns the name of the CMap.
|
String |
getOrdering()
Returns the ordering of the CIDSystemInfo.
|
String |
getRegistry()
Returns the registry of the CIDSystemInfo.
|
int |
getSpaceMapping()
Returns the mapping for the space character.
|
int |
getSupplement()
Returns the supplement of the CIDSystemInfo.
|
int |
getType()
Returns the type of the CMap.
|
String |
getVersion()
Returns the version of the CMap.
|
int |
getWMode()
Returns the WMode of a CMap.
|
boolean |
hasCIDMappings()
This will tell if this cmap has any CID mappings.
|
boolean |
hasOneByteMappings()
This will tell if this cmap has any one byte mappings.
|
boolean |
hasTwoByteMappings()
This will tell if this cmap has any two byte mappings.
|
boolean |
isInCodeSpaceRanges(byte[] code)
Check whether the given byte array is in codespace ranges or not.
|
boolean |
isInCodeSpaceRanges(byte[] code,
int offset,
int length)
Check whether the given byte array is in codespace ranges or not.
|
String |
lookup(byte[] code,
int offset,
int length)
This will perform a lookup into the map.
|
String |
lookup(int code,
int length)
This will perform a lookup into the map.
|
int |
lookupCID(byte[] code,
int offset,
int length)
This will perform a lookup into the CID map.
|
String |
lookupCID(int cid)
This will perform a lookup into the CID map.
|
void |
setName(String name)
Sets the name of the CMap.
|
void |
setOrdering(String newOrdering)
Sets the ordering of the CIDSystemInfo.
|
void |
setRegistry(String newRegistry)
Sets the registry of the CIDSystemInfo.
|
void |
setSupplement(int newSupplement)
Sets the supplement of the CIDSystemInfo.
|
void |
setType(int type)
Sets the type of the CMap.
|
void |
setVersion(String version)
Sets the version of the CMap.
|
void |
setWMode(int newWMode)
Sets the WMode of a CMap.
|
void |
useCmap(CMap cmap)
Implementation of the usecmap operator.
|
public boolean hasOneByteMappings()
public boolean hasTwoByteMappings()
public boolean hasCIDMappings()
public String lookup(byte[] code, int offset, int length)
code
- The code used to lookup.offset
- The offset into the byte array.length
- The length of the data we are getting.public String lookup(int code, int length)
code
- The code used to lookup.length
- The length of the data we are getting.public String lookupCID(int cid)
cid
- The CID used to lookup.public int lookupCID(byte[] code, int offset, int length)
code
- The code used to lookup.offset
- the offset into the array.length
- the length of the subarray.public void addMapping(byte[] src, String dest) throws IOException
src
- The src to the mapping.dest
- The dest to the mapping.IOException
- if the src is invalid.public void addCIDMapping(int src, String dest) throws IOException
src
- The CID to the mapping.dest
- The dest to the mapping.IOException
- if the src is invalid.public void addCIDRange(char from, char to, int cid)
from
- starting charactor of the CID range.to
- ending character of the CID range.cid
- the cid to be started with.public void addCodespaceRange(CodespaceRange range)
range
- A single codespace range.public List<CodespaceRange> getCodeSpaceRanges()
public void useCmap(CMap cmap)
cmap
- The cmap to load mappings from.public boolean isInCodeSpaceRanges(byte[] code)
code
- The byte array to look for in the codespace range.public boolean isInCodeSpaceRanges(byte[] code, int offset, int length)
code
- The byte array to look for in the codespace range.offset
- The starting offset within the byte array.length
- The length of the part of the array.public int getWMode()
public void setWMode(int newWMode)
newWMode
- the new WMode.public String getName()
public void setName(String name)
name
- the CMap name.public String getVersion()
public void setVersion(String version)
version
- the CMap version.public int getType()
public void setType(int type)
type
- the CMap type.public String getRegistry()
public void setRegistry(String newRegistry)
newRegistry
- the registry.public String getOrdering()
public void setOrdering(String newOrdering)
newOrdering
- the ordering.public int getSupplement()
public void setSupplement(int newSupplement)
newSupplement
- the supplement.public int getSpaceMapping()
Copyright © 2002–2015 The Apache Software Foundation. All rights reserved.