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.
  • Method Details

    • 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
    • isBuiltWith

      public boolean isBuiltWith (String fontProgram, String encoding)
      Description copied from class: PdfFont
      Checks whether the PdfFont was built with corresponding fontProgram and encoding or CMAP. Default value is false unless overridden.
      Overrides:
      isBuiltWith in class PdfSimpleFont<TrueTypeFont>
      Parameters:
      fontProgram - a font name or path to a font program
      encoding - an encoding or CMAP
      Returns:
      true, if the PdfFont was built with the fontProgram and encoding. Otherwise false.
      See Also:
    • addFontStream

      protected void addFontStream (PdfDictionary fontDescriptor)
      Specified by:
      addFontStream in class PdfSimpleFont<TrueTypeFont>
    • 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