Class OTFParser


  • public final class OTFParser
    extends TTFParser
    OpenType font file parser.
    • Constructor Detail

      • OTFParser

        public OTFParser()
        Constructor.
      • OTFParser

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

        public OTFParser​(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 OpenTypeFont parse​(java.lang.String file)
                           throws java.io.IOException
        Description copied from class: TTFParser
        Parse a file and return a TrueType font.
        Overrides:
        parse in class TTFParser
        Parameters:
        file - The TrueType font filename.
        Returns:
        A TrueType font.
        Throws:
        java.io.IOException - If there is an error parsing the TrueType font.
      • parse

        public OpenTypeFont parse​(java.io.File file)
                           throws java.io.IOException
        Description copied from class: TTFParser
        Parse a file and return a TrueType font.
        Overrides:
        parse in class TTFParser
        Parameters:
        file - The TrueType font file.
        Returns:
        A TrueType font.
        Throws:
        java.io.IOException - If there is an error parsing the TrueType font.
      • parse

        public OpenTypeFont parse​(java.io.InputStream data)
                           throws java.io.IOException
        Description copied from class: TTFParser
        Parse an input stream and return a TrueType font.
        Overrides:
        parse in class TTFParser
        Parameters:
        data - The TTF data stream to parse from. It will be closed before returning.
        Returns:
        A TrueType font.
        Throws:
        java.io.IOException - If there is an error parsing the TrueType font.
      • parse

        OpenTypeFont parse​(TTFDataStream raf)
                    throws java.io.IOException
        Description copied from class: TTFParser
        Parse a file and get a true type font.
        Overrides:
        parse in class TTFParser
        Parameters:
        raf - The TTF file.
        Returns:
        A TrueType font.
        Throws:
        java.io.IOException - If there is an error parsing the TrueType font.