MCPcopy Create free account
hub / github.com/LibPDF-js/core / embedFont

Method embedFont

src/api/pdf.ts:2060–2062  ·  view source on GitHub ↗

* Embed a font for use in the document. * * Convenience method that delegates to `pdf.fonts.embed()`. * * @param data - Font data (TTF, OTF, or Type1) * @param options - Embedding options * @returns EmbeddedFont instance for encoding text * @throws {Error} If font data is invali

(data: Uint8Array, options?: EmbedFontOptions)

Source from the content-addressed store, hash-verified

2058 * @throws {Error} If font data is invalid or unsupported format
2059 */
2060 embedFont(data: Uint8Array, options?: EmbedFontOptions): EmbeddedFont {
2061 return this.fonts.embed(data, options);
2062 }
2063
2064 /**
2065 * Get the reference for an embedded font.

Callers 9

drawing.test.tsFile · 0.80
pdf-fonts.test.tsFile · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80

Calls 1

embedMethod · 0.80

Tested by

no test coverage detected