Class PDType0Font


  • public class PDType0Font
    extends PDCIDFont
    Represents Type0 font on pd level. Note that on the cos level object of this class is a COSDictionary of descendant font.
    Author:
    Sergey Shemyakov
    • Constructor Detail

      • PDType0Font

        public PDType0Font​(COSDictionary dictionary)
        Constructs PD Type 0 font from font dictionary.
        Parameters:
        dictionary -
    • Method Detail

      • getCMap

        public PDCMap getCMap()
        Returns:
        PD CMap associated with this Type 0 font as specified by Encoding key in font dictionary.
      • getDescendantFontObject

        public COSObject getDescendantFontObject()
        Returns:
        COSObject that is font dictionary for descendant font.
      • getDescendantFont

        public COSDictionary getDescendantFont()
        Returns:
        COSDictionary that is font dictionary for descendant font.
      • toUnicode

        public String toUnicode​(int code)
        This method maps character code to a Unicode value. Firstly it checks toUnicode CMap, then it behaves like described in PDF32000_2008 9.10.2 "Mapping Character Codes to Unicode Values" for Type0 font.
        Overrides:
        toUnicode in class PDFont
        Parameters:
        code - is code for character.
        Returns:
        unicode value.
      • setFontProgramFromDescendant

        public void setFontProgramFromDescendant​(PDCIDFont descendant)
        Updates font program information from descendant CID font.
        Parameters:
        descendant - is descendant CID font for this Type 0 font.
      • getType0FontDict

        public COSDictionary getType0FontDict()
        Returns:
        COSDictionary that is font dictionary of this Type 0 font.
      • getSubtype

        public ASAtom getSubtype()
        Overrides:
        getSubtype in class PDFont
        Returns:
        font subtype (Subtype entry).
      • toCID

        public int toCID​(int code)
        Gets CID value for given character code from this font.
        Parameters:
        code - is character code.
        Returns:
        CID value for code.