Class CMapToUnicode


  • public class CMapToUnicode
    extends AbstractCMap
    This class represents a CMap file.
    • Field Detail

      • byteMappings

        private final java.util.Map<java.lang.Integer,​char[]> byteMappings
      • codeSpaceRanges

        private final java.util.List<byte[]> codeSpaceRanges
    • Constructor Detail

      • CMapToUnicode

        private CMapToUnicode​(boolean emptyCMap)
      • CMapToUnicode

        public CMapToUnicode()
        Creates a new instance of CMap.
    • Method Detail

      • hasByteMappings

        public boolean hasByteMappings()
        This will tell if this cmap has any two byte mappings.
        Returns:
        true If there are any two byte mappings, false otherwise.
      • lookup

        public char[] lookup​(byte[] code,
                             int offset,
                             int length)
        This will perform a lookup into the map.
        Parameters:
        code - The code used to lookup.
        offset - The offset into the byte array.
        length - The length of the data we are getting.
        Returns:
        The string that matches the lookup.
      • lookup

        public char[] lookup​(byte[] code)
      • lookup

        public char[] lookup​(int code)
      • getCodes

        public java.util.Set<java.lang.Integer> getCodes()
      • createDirectMapping

        public IntHashtable createDirectMapping()
      • createReverseMapping

        public java.util.Map<java.lang.Integer,​java.lang.Integer> createReverseMapping()
      • getCodeSpaceRanges

        public java.util.List<byte[]> getCodeSpaceRanges()
        Returns a list containing sequential pairs of code space beginning and endings: (begincodespacerange1, endcodespacerange1, begincodespacerange2, endcodespacerange1, ...)
        Returns:
        list of byte[] that contain code space ranges
      • convertToInt

        private int convertToInt​(char[] s)
      • addChar

        void addChar​(int cid,
                     char[] uni)
      • createCharsFromSingleBytes

        private char[] createCharsFromSingleBytes​(byte[] bytes)
      • createCharsFromDoubleBytes

        private char[] createCharsFromDoubleBytes​(byte[] bytes)