Class PdfTrueTypeFont


  • public class PdfTrueTypeFont
    extends PdfSimpleFont<TrueTypeFont>
    Note. For TrueType FontNames.getStyle() is the same to Subfamily(). So, we shouldn't add style to /BaseFont.
    • Constructor Detail

      • PdfTrueTypeFont

        PdfTrueTypeFont​(TrueTypeFont ttf,
                        java.lang.String encoding,
                        boolean embedded)
      • PdfTrueTypeFont

        PdfTrueTypeFont​(PdfDictionary fontDictionary)
    • Method Detail

      • getGlyph

        public Glyph getGlyph​(int unicode)
        Description copied from class: PdfFont
        Get glyph by unicode
        Specified by:
        getGlyph in class PdfFont
        Parameters:
        unicode - a unicode code point
        Returns:
        Glyph if it exists or .NOTDEF if supported, otherwise null.
      • containsGlyph

        public boolean containsGlyph​(int unicode)
        Description copied from class: PdfFont
        Check whether font contains glyph with specified unicode.
        Overrides:
        containsGlyph in class PdfFont
        Parameters:
        unicode - a unicode code point
        Returns:
        true if font contains glyph, represented with the unicode code point, otherwise false.
      • flush

        public void flush()
        Description copied from class: PdfFont
        To manually flush a PdfObject behind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly call PdfObjectWrapper.makeIndirect(PdfDocument). For example: wrapperInstance.makeIndirect(document).flush(); Note that not every wrapper require this, only those that have such warning in documentation.
        Overrides:
        flush in class PdfFont
      • isBuiltInFont

        protected boolean isBuiltInFont()
        Indicates that the font is built in, i.e. it is one of the 14 Standard fonts
        Overrides:
        isBuiltInFont in class PdfSimpleFont<TrueTypeFont>
        Returns:
        true in case the font is a Standard font and false otherwise