Class BaseTrueTypeProgram

    • Constructor Detail

      • BaseTrueTypeProgram

        public BaseTrueTypeProgram​(ASInputStream stream)
                            throws IOException
        Constructor from stream containing font data, and encoding details.
        Parameters:
        stream - is stream containing font data.
        Throws:
        IOException - if creation of @{link SeekableStream} fails.
    • Method Detail

      • parseFont

        public void parseFont()
                       throws IOException
        Parses True Type font from given stream and extracts all the data needed.
        Specified by:
        parseFont in interface FontProgram
        Throws:
        IOException - if stream-reading error occurs.
      • getNrOfCMaps

        public int getNrOfCMaps()
        Returns:
        array, containing platform ID and encoding ID for each cmap in this True Type font.
      • getNGlyphs

        public int getNGlyphs()
        Returns:
        number of glyphs in this font.
      • isCmapPresent

        public boolean isCmapPresent​(int platformID,
                                     int encodingID)
        Returns true if cmap table with given platform ID and encoding ID is present in the font.
        Parameters:
        platformID - is platform ID of requested cmap.
        encodingID - is encoding ID of requested cmap.
        Returns:
        true if requested cmap is present.
      • getWidthWithCheck

        protected float getWidthWithCheck​(int gid)
      • isAttemptedParsing

        public boolean isAttemptedParsing()
        Specified by:
        isAttemptedParsing in interface FontProgram
        Returns:
        true if font parsing has been attempted.
      • isSuccessfulParsing

        public boolean isSuccessfulParsing()
        Specified by:
        isSuccessfulParsing in interface FontProgram
        Returns:
        true if font was successfully parsed.