Class CIDToGIDMapping


  • public class CIDToGIDMapping
    extends Object
    Provides interface for working with CIDToGID mapping in Type 2 CID fonts.
    Author:
    Sergey Shemyakov
    • Constructor Detail

      • CIDToGIDMapping

        public CIDToGIDMapping​(COSObject obj)
                        throws IOException
        Constructor from COSObject, containing CIDToGID.
        Parameters:
        obj - is COSObject, obtained via key CIDToGIDMap in CIDFontType2 dict.
        Throws:
        IOException
    • Method Detail

      • getGID

        public int getGID​(int cid)
        Gets GID for given CID with use of this CIDToGIDMap.
        Parameters:
        cid - is character ID.
        Returns:
        glyph ID for cid or 0 of no GID is found.
      • contains

        public boolean contains​(int cid)
        Checks if given CID can be mapped into GID with this CIDToGID mapping.
        Parameters:
        cid - is CID to check.
        Returns:
        true if cid can be mapped into GID.
      • isIdentity

        public boolean isIdentity()
      • getMappingSize

        public int getMappingSize()