[]
Represents a Type3 font in a PDF document.
Type 3 fonts differ from the other fonts supported by PDF. In Type 3 fonts, glyphs are defined by streams of PDF graphics operators. These streams are associated with character names. Note! PdfFontType3 does not support the PdfFont#createNativeFont method, it returns null.
get baseFont(): string;
Gets or sets the PostScript name of the font.
string
set baseFont(value): void;
Gets or sets the PostScript name of the font.
string
void
get id(): number;
Gets the reference to the object.
number
get isEmbedded(): boolean;
Gets a value indicating whether the font is embedded.
boolean
get om(): ObjectManager;
Gets the owner ObjectManager instance.
createNativeFont(): Font;
Gets a Font object created from the embedded font data.
Note that this method will return null if the font is not embedded or does not support this operation (e.g. Type3 fonts).
The Font object.
PdfFontSimple.createNativeFont
findNativeFont(doc, allowStandardPdfFonts?): Font;
Finds the most suitable native font for rendering text associated with this PDF font.
The PDF specification does not define a precise algorithm for selecting a font when no embedded font data is available. This method uses a combination of heuristics and practical strategies to choose an appropriate native font.
The PdfDocument that owns this font.
boolean
If true (the default), also searches the 14 standard PDF fonts if a suitable font could not be found among the registered fonts.
The native font that matches the current PDF font, or null if a match could not be found.
free(): void;
Detaches the object from the ObjectManager and deallocates its memory, if possible.
void
getEmbeddedData(): Uint8Array<ArrayBufferLike>;
Returns the embedded font data, returns null if the font is not embedded.
Uint8Array<ArrayBufferLike>
The embedded font data or null if the font is not embedded.
getFontAttributes(): PdfFontAttributes;
Extracts the attributes of the current font. If a specific attribute cannot be determined, the corresponding value is set to null.
The PdfFontAttributes object containing the font attributes.
PdfFontSimple.getFontAttributes
getFontDescriptor(): PdfFontDescriptor;
Gets a PdfFontDescriptor object that describes the font.
The PdfFontDescriptor object.
PdfFontSimple.getFontDescriptor
rebind(omTo): void;
Rebinds the object from the current ObjectManager to the specified one.
The new ObjectManager for the object.
void
removeEmbeddedData(doc): void;
Removes the embedded font data.
Please note that a PDF may display incorrectly after removing an embedded font's data. Use with caution.
The document that owns the font.
void
PdfFontSimple.removeEmbeddedData
tryGetPdfCode(unicode): PdfCodeInfo;
Tries to convert a Unicode value to the character's PDF code.
Note that this method can fail if the font does not contain the necessary info for the conversion or does not contain the specified Unicode value, in this case null is returned.
Note also that this method can be slow as it uses large font tables like /Encoding, /ToUnicode etc., so it is recommended that the returned results are cached by the caller.
string
The character Unicode.
The PdfCodeInfo object containing the character PDF code, or null if the conversion failed.
tryGetUnicode(pdfCode): string;
Converts a character's PDF code to its Unicode value.
Note that this method can fail if the font does not contain the necessary info for the conversion, in this case null is returned.
Note also that this method can be slow as it uses large font tables like /Encoding, /ToUnicode etc., so the returned results better be cached by the caller.
number
The character PDF code.
string
The character Unicode, or null if the conversion failed.