ProtectedauxiliaryAuxiliary objects that must be committed along with the font dict. Includes FontDescriptor, FontFile2, CIDFont, ToUnicode, etc.
OptionalcontainerReference to the container indirect object that wraps this font dict. Set by FontManager.write() when the font is committed to the PDF.
ProtectedmodifiedIndicates whether the object has been modified. By default, assume it has been modified because it's a new object
OptionalpostOptional tokens to prepend or append during serialization
OptionalpreOptional tokens to prepend or append during serialization
The PDF resource name used in content streams (e.g., 'F1', 'F2').
This is the identifier used in PDF operators like /F1 12 Tf.
Gets the font descriptor with metrics and properties. Available for embedded fonts, undefined for standard fonts or loaded fonts without descriptor.
Gets the first character code in the Widths array.
Sets the first character code in the Widths array.
Gets the original font file bytes. Available for embedded fonts, undefined for standard fonts or loaded fonts.
InternalLegacy property for backward compatibility with code that accesses fontRef. Returns the container object if available.
Gets the font type (Subtype in PDF).
Sets the font type (Subtype in PDF).
Gets the last character code in the Widths array.
Sets the last character code in the Widths array.
The type of this PDF object
Gets the character widths array.
Sets the character widths array.
Creates a deep clone of the object
Returns an iterator for the dictionary entries. Each entry is a tuple of [key string, value].
Compares this object to another for equality based on their token representations
Optionalother: PdfObjectReturns all objects that need to be committed to the PDF. Includes auxiliary objects (descriptors, streams) and the container.
Indicates whether the object has been modified. Override this method if the modified state is determined differently
Sets the modified state of the object. Override this method if the modified state is determined differently
Converts the object to a ByteArray, optionally padding to a specified length
OptionalpadTo: numberProtectedtokenizeTokenizes the object into an array of PdfTokens
Returns the resource name for string coercion. This enables using PdfFont objects in template literals like:
const da = `/${font} 12 Tf 0 g`
Converts the object to an array of PdfTokens, including any pre or post tokens
StaticfromStaticfromCreates a PdfFont from a FontParser instance. Extracts all necessary information from the parser including font name, descriptor, and font data.
A FontParser instance (TtfParser, OtfParser, or WoffParser)
A PdfFont instance ready to be written to the PDF
StaticfromCreates a standard PDF Type1 font (one of the 14 built-in fonts). These fonts don't require font data as they're built into PDF viewers.
One of the 14 standard PDF fonts
A PdfFont instance ready to be written to the PDF
StaticfromCreates a TrueType font from font file data. Uses WinAnsiEncoding for standard 8-bit character support.
The TrueType font file bytes
The name to use for this font in the PDF
Font metrics and properties
A PdfFont instance ready to be written to the PDF
StaticfromCreates a Type0 (composite) font with Unicode support. Use this for fonts that need to display non-ASCII characters.
The TrueType font file bytes
The name to use for this font in the PDF
Unicode font descriptor with CID metrics
OptionalunicodeMappings: Map<number, number>Optional map of CID to Unicode code point for ToUnicode CMap
A PdfFont instance ready to be written to the PDF
Represents an embedded font in a PDF document. Extends PdfDictionary to provide both font metadata and PDF dictionary structure.