Embeds a font from file data with automatic parsing and configuration. This is the recommended high-level API for embedding fonts.
The font file bytes (TTF, OTF, or WOFF format)
Optionaloptions: { fontName?: string; unicode?: boolean; unicodeMappings?: Map<number, number> }Optional configuration
OptionalfontName?: stringCustom font name (defaults to PostScript name from font)
Optionalunicode?: booleanUse Unicode/Type0 encoding for non-ASCII characters
OptionalunicodeMappings?: Map<number, number>Custom CID to Unicode mappings for Type0 fonts
A PdfFont object representing the embedded font
Embeds a standard PDF font (Type1). These fonts don't require font data as they're built into PDF viewers.
One of the 14 standard PDF fonts
A PdfFont object representing the embedded font
Embeds a TrueType font into the PDF document.
The font file bytes
The name to use for this font in the PDF
Font metrics and properties
A PdfFont object representing the embedded font
Embeds a TrueType font with Unicode/Type0 support. Use this for fonts that need to display non-ASCII characters.
The font file bytes
The name to use for this font in the PDF
Unicode font descriptor with CID metrics
OptionalunicodeMappings: Map<number, number>Map of CID to Unicode code point for ToUnicode CMap
A PdfFont object representing the embedded font
Gets all embedded fonts. Searches the PDF structure to find all fonts.
Gets the font reference by font name or resource name.
Loads existing fonts from the PDF document. Traverses the page tree and extracts font information from page resources.
Map of font names to their PdfFont objects
Manages font embedding in PDF documents. Provides methods to embed TrueType and other font formats.