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 Details

    • CMap

      public CMap()
  • Method Details

    • 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()