Class TTFParser

  • Direct Known Subclasses:
    OTFParser

    public class TTFParser
    extends Object
    TrueType font file parser.
    • Constructor Detail

      • TTFParser

        public TTFParser()
        Constructor.
      • TTFParser

        public TTFParser​(boolean isEmbedded)
        Constructor.
        Parameters:
        isEmbedded - true if the font is embedded in PDF
      • TTFParser

        public TTFParser​(boolean isEmbedded,
                         boolean parseOnDemand)
        Constructor.
        Parameters:
        isEmbedded - true if the font is embedded in PDF
        parseOnDemand - true if the tables of the font should be parsed on demand
    • Method Detail

      • parse

        public TrueTypeFont parse​(String ttfFile)
                           throws IOException
        Parse a file and get a true type font.
        Parameters:
        ttfFile - The TTF file.
        Returns:
        A true type font.
        Throws:
        IOException - If there is an error parsing the true type font.
      • parse

        public TrueTypeFont parse​(File ttfFile)
                           throws IOException
        Parse a file and get a true type font.
        Parameters:
        ttfFile - The TTF file.
        Returns:
        A true type font.
        Throws:
        IOException - If there is an error parsing the true type font.
      • parse

        public TrueTypeFont parse​(InputStream ttfData)
                           throws IOException
        Parse a file and get a true type font.
        Parameters:
        ttfData - The TTF data to parse.
        Returns:
        A true type font.
        Throws:
        IOException - If there is an error parsing the true type font.
      • parseEmbedded

        public TrueTypeFont parseEmbedded​(InputStream ttfData)
                                   throws IOException
        Parse a file and get a true type font.
        Parameters:
        ttfData - The TTF data to parse.
        Returns:
        A true type font.
        Throws:
        IOException - If there is an error parsing the true type font.