Class PDCIDFontType2

    • Constructor Detail

      • PDCIDFontType2

        public PDCIDFontType2​(COSDictionary fontDictionary,
                              PDType0Font parent)
                       throws IOException
        Constructor.
        Parameters:
        fontDictionary - The font dictionary according to the PDF specification.
        Throws:
        IOException
    • Method Detail

      • codeToCID

        public int codeToCID​(int code)
        Description copied from class: PDCIDFont
        Returns the CID for the given character code. If not found then CID 0 is returned.
        Specified by:
        codeToCID in class PDCIDFont
        Parameters:
        code - character code
        Returns:
        CID
      • codeToGID

        public int codeToGID​(int code)
                      throws IOException
        Returns the GID for the given character code.
        Specified by:
        codeToGID in class PDCIDFont
        Parameters:
        code - character code
        Returns:
        GID
        Throws:
        IOException
      • getHeight

        public float getHeight​(int code)
                        throws IOException
        Description copied from interface: PDFontLike
        Returns the height of the given character, in glyph space. This can be expensive to calculate. Results are only approximate.
        Specified by:
        getHeight in interface PDFontLike
        Specified by:
        getHeight in class PDCIDFont
        Parameters:
        code - character code
        Throws:
        IOException
      • encode

        public byte[] encode​(int unicode)
        Description copied from class: PDCIDFont
        Encodes the given Unicode code point for use in a PDF content stream. Content streams use a multi-byte encoding with 1 to 4 bytes.

        This method is called when embedding text in PDFs and when filling in fields.

        Specified by:
        encode in class PDCIDFont
        Parameters:
        unicode - Unicode code point.
        Returns:
        Array of 1 to 4 PDF content stream bytes.
      • isDamaged

        public boolean isDamaged()
        Description copied from interface: PDFontLike
        Returns true if the embedded font file is damaged.
      • getTrueTypeFont

        public TrueTypeFont getTrueTypeFont()
        Returns the embedded or substituted TrueType font. May be an OpenType font if the font is not embedded.
      • getPath

        public android.graphics.Path getPath​(int code)
                                      throws IOException
        Description copied from interface: PDVectorFont
        Returns the glyph path for the given character code.
        Parameters:
        code - character code
        Throws:
        IOException - if the font could not be read
      • hasGlyph

        public boolean hasGlyph​(int code)
                         throws IOException
        Description copied from interface: PDVectorFont
        Returns true if this font contains a glyph for the given character code.
        Parameters:
        code - character code
        Throws:
        IOException