Package org.verapdf.pd.font.cmap
Class CMap
- java.lang.Object
-
- org.verapdf.pd.font.cmap.CMap
-
- Direct Known Subclasses:
IdentityCMap
public class CMap extends Object
This class represents cmap.- Author:
- Sergey Shemyakov
-
-
Constructor Summary
Constructors Constructor Description CMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsCode(int character)List<org.verapdf.pd.font.cmap.CIDMappable>getCidMappings()intgetCodeFromStream(InputStream stream)Reads character code from input stream and returnes it's CID.StringgetName()StringgetOrdering()StringgetRegistry()intgetSupplement()StringgetUnicode(int code)Returns Unicode sequence for given character code.intgetwMode()booleanisUsesNonPredefinedCMap()voidsetSupplement(int supplement)voidsetUsesNonPredefinedCMap(boolean usesNonPredefinedCMap)Sets indicator for CMap to contain reference to a non-predefined CMap.inttoCID(int character)Gets CID for given character.voiduseCMap(CMap another)Method adds all the data needed to this CMap from another CMap.
-
-
-
Method Detail
-
toCID
public int toCID(int character)
Gets CID for given character.- Parameters:
character- is code of character, for which CID is calculated.- Returns:
- CID for given character or 0 if it cannot be obtained.
-
containsCode
public boolean containsCode(int character)
- Returns:
- true if this CMap can convert given code to CID.
-
getCodeFromStream
public int getCodeFromStream(InputStream stream) throws IOException
Reads character code from input stream and returnes it's CID. This uses codespace information from CMap. Details are described in PDF32000 in 9.7.6.2 "CMap Mapping".- Parameters:
stream- is stream from which character codes will be read.- Returns:
- CID of read code.
- Throws:
IOException
-
useCMap
public void useCMap(CMap another)
Method adds all the data needed to this CMap from another CMap.- Parameters:
another- is another CMap.
-
getwMode
public int getwMode()
- Returns:
- writing mode of given CMap.
-
getRegistry
public String getRegistry()
- Returns:
- Registry value from CIDSystemInfo dictionary.
-
getOrdering
public String getOrdering()
- Returns:
- Ordering value from CIDSystemInfo dictionary.
-
getSupplement
public int getSupplement()
- Returns:
- supplement of CMap.
-
setSupplement
public void setSupplement(int supplement)
-
isUsesNonPredefinedCMap
public boolean isUsesNonPredefinedCMap()
- Returns:
- true if this CMap references non-predefined CMap with usecmap operator.
-
setUsesNonPredefinedCMap
public void setUsesNonPredefinedCMap(boolean usesNonPredefinedCMap)
Sets indicator for CMap to contain reference to a non-predefined CMap.
-
getUnicode
public String getUnicode(int code)
Returns Unicode sequence for given character code.- Parameters:
code- is code of character.- Returns:
- Unicode sequence obtained from this CMap.
-
getName
public String getName()
- Returns:
- name of this CMap.
-
getCidMappings
public List<org.verapdf.pd.font.cmap.CIDMappable> getCidMappings()
-
-