Class PDType1Font


  • public class PDType1Font
    extends PDSimpleFont
    Class represents Type 1 font on PD level.
    Author:
    Sergey Shemyakov
    • Constructor Detail

      • PDType1Font

        public PDType1Font​(COSDictionary dictionary)
        Constructor from type 1 font dictionary.
        Parameters:
        dictionary - is type 1 font dictionary.
    • Method Detail

      • getDescriptorCharSet

        public Set<String> getDescriptorCharSet()
        Returns:
        set of character names defined in font as specified in CIDSet in font descriptor.
      • isStandard

        public Boolean isStandard()
        Returns:
        true if this font is one of standard 14 fonts.
      • getWidth

        public Double getWidth​(int code)
        Gets width for glyph with given code in this font.
        Overrides:
        getWidth in class PDFont
        Parameters:
        code - is code of glyph.
        Returns:
        width for glyph with given code as specified in Widths array.
      • getWidthFromProgram

        public float getWidthFromProgram​(int code)
        Description copied from class: PDFont
        Gets width of given code from font program.
        Specified by:
        getWidthFromProgram in class PDFont
        Parameters:
        code - is code of character in strings to display.
        Returns:
        width of glyph for this code.
      • glyphIsPresent

        public boolean glyphIsPresent​(int code)
        Description copied from class: PDFont
        Checks if glyph for given code is present in this font.
        Specified by:
        glyphIsPresent in class PDFont
        Parameters:
        code - is code for glyph in this font.
        Returns:
        true if glyph is present.
      • toUnicodePDFA1

        public String toUnicodePDFA1​(int code)
        Get's Unicode value of character as it is described in PDF/A-1 specification. The difference from usual toUnicode method is in standard encoding and symbol set lookups for the glyph name.
        Parameters:
        code - is code of character.
        Returns:
        Unicode value.