org.apache.fop.pdf

## Class PDFFontNonBase14

- java.lang.Object
- - org.apache.fop.pdf.PDFObject
  - - org.apache.fop.pdf.PDFDictionary
    - - org.apache.fop.pdf.PDFFont
      - - org.apache.fop.pdf.PDFFontNonBase14

- All Implemented Interfaces:
    PDFWritable
  Direct Known Subclasses:
    PDFFontTrueType, PDFFontType1, PDFFontType3

      public abstract class PDFFontNonBase14
      extends PDFFont

  A common ancestor for Type1, TrueType, MMType1 and Type3 fonts (all except base 14 fonts).

- - ### Field Summary

    - ### Fields inherited from class org.apache.fop.pdf.PDFDictionary

      `entries, order`

    - ### Fields inherited from class org.apache.fop.pdf.PDFObject

      `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PDFFontNonBase14(String fontname, FontType subtype, String basefont, Object encoding)` Create the /Font object

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PDFFontDescriptor` | `getDescriptor()`
    `void` | `setDescriptor(PDFFontDescriptor descriptor)` Set the font descriptor (unused for the Type3 fonts)
    `void` | `setWidthMetrics(int firstChar, int lastChar, PDFArray widths)` Set the width metrics for the font
    `protected void` | `validate()` Validates the PDF object prior to serialization.

    - ### Methods inherited from class org.apache.fop.pdf.PDFFont

      `createFont, getBaseFont, getName, getPDFNameForFontType, output, setEncoding, setEncoding, setToUnicode`

    - ### Methods inherited from class org.apache.fop.pdf.PDFDictionary

      `containsKey, get, getChildren, getChildren, keySet, put, put, remove, writeDictionary`

    - ### Methods inherited from class org.apache.fop.pdf.PDFObject

      `contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PDFFontNonBase14

          public PDFFontNonBase14(String fontname,
                                  FontType subtype,
                                  String basefont,
                                  Object encoding)

      Create the /Font object
      Parameters:
        `fontname` - the internal name for the font
        `subtype` - the font's subtype
        `basefont` - the base font name
        `encoding` - the character encoding schema used by the font

  - ### Method Detail

    - #### setWidthMetrics

          public void setWidthMetrics(int firstChar,
                                      int lastChar,
                                      PDFArray widths)

      Set the width metrics for the font
      Parameters:
        `firstChar` - the first character code in the font
        `lastChar` - the last character code in the font
        `widths` - an array of size (lastChar - firstChar +1)

    - #### setDescriptor

          public void setDescriptor(PDFFontDescriptor descriptor)

      Set the font descriptor (unused for the Type3 fonts)
      Parameters:
        `descriptor` - the descriptor for other font's metrics

    - #### getDescriptor

          public PDFFontDescriptor getDescriptor()

      Returns:
        the FontDescriptor or null if there is none

    - #### validate

          protected void validate()

      Validates the PDF object prior to serialization.
      Overrides:
        `validate` in class `PDFFont`

Copyright © 2023 Apache Software Foundation. All rights reserved.