Package com.orsonpdf

Class PDFFont


public class PDFFont extends PDFObject
A PDFObject representing a PDF font.
  • Field Details

    • HELVETICA

      public static final String HELVETICA
      Identifier for the standard PDF font 'Helvetica'.
      See Also:
    • HELVETICA_BOLD

      public static final String HELVETICA_BOLD
      Identifier for the standard PDF font 'Helvetica-Bold'.
      See Also:
    • HELVETICA_OBLIQUE

      public static final String HELVETICA_OBLIQUE
      Identifier for the standard PDF font 'Helvetica-Oblique'.
      See Also:
    • HELVETICA_BOLDOBLIQUE

      public static final String HELVETICA_BOLDOBLIQUE
      Identifier for the standard PDF font 'Helvetica-BoldOblique'.
      See Also:
    • TIMES_ROMAN

      public static final String TIMES_ROMAN
      Identifier for the standard PDF font 'Times-Roman'.
      See Also:
    • TIMES_BOLD

      public static final String TIMES_BOLD
      Identifier for the standard PDF font 'Times-Bold'.
      See Also:
    • TIMES_ITALIC

      public static final String TIMES_ITALIC
      Identifier for the standard PDF font 'Times-Italic'.
      See Also:
    • TIMES_BOLDITALIC

      public static final String TIMES_BOLDITALIC
      Identifier for the standard PDF font 'Times-BoldItalic'.
      See Also:
    • COURIER

      public static final String COURIER
      Identifier for the standard PDF font 'Courier'.
      See Also:
    • COURIER_BOLD

      public static final String COURIER_BOLD
      Identifier for the standard PDF font 'Courier-Bold'.
      See Also:
    • COURIER_ITALIC

      public static final String COURIER_ITALIC
      Identifier for the standard PDF font 'Courier-Italic'.
      See Also:
    • COURIER_BOLDITALIC

      public static final String COURIER_BOLDITALIC
      Identifier for the standard PDF font 'Courier-BoldItalic'.
      See Also:
    • name

      private String name
    • baseFont

      private String baseFont
      The BaseFont (for example, "/Helvetica").
    • encoding

      private String encoding
  • Constructor Details

    • PDFFont

      PDFFont(int number, int generation, String name, String baseFont, String encoding)
      Creates a new PDFFont instance.
      Parameters:
      number - the PDF object number.
      generation - the PDF object generation number.
      name - the font name within the PDF document.
      baseFont - the base font name.
      encoding - the encoding.
  • Method Details

    • getName

      public String getName()
      Returns the name of the font within the PDF document (this is not the same as the font name).
      Returns:
      The font name.
    • getObjectBytes

      public byte[] getObjectBytes()
      Returns the bytes that go between the 'obj' and 'endobj' in the PDF output for this object.
      Specified by:
      getObjectBytes in class PDFObject
      Returns:
      A byte array.
    • createDictionary

      private Dictionary createDictionary()