Skip to content

Commit 97b14f4

Browse files
author
FAL
committed
update comments
1 parent 1122a85 commit 97b14f4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/api/PDFDocument.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ export class PDFDocument {
915915
* ```
916916
* @param font The input data for a font.
917917
* @param options The options to be used when embedding the font.
918-
* @returns Resolves with the embedded font.
918+
* @returns The embedded font represented as `PDFFont`.
919919
*/
920920
embedFont(
921921
font: StandardFonts | string | Uint8Array | ArrayBuffer,
@@ -954,11 +954,14 @@ export class PDFDocument {
954954

955955
/**
956956
* Embed a fontkit `TTFFont` instance into this document.
957-
* This always performs font subsetting.
957+
*
958+
* NOTE: `options.subset` must be `true`, because the non-subset font embedder requires
959+
* the raw font bytes which are not available from a `TTFFont` instance.
958960
*
959961
* @param font The `TTFFont` to subset and embed.
960962
* @param options Additional embedding options (the `subset` option must be `true` or omitted).
961-
* @returns Resolves with the embedded font.
963+
* @returns The embedded font represented as `PDFFont`.
964+
* @throws If `options.subset` is not `true`.
962965
*/
963966
embedTTFFont(
964967
font: TTFFont,

0 commit comments

Comments
 (0)