Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

Commit 8a44bbf

Browse files
committed
Not check font from constructor
1 parent 89c1876 commit 8a44bbf

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/font.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ export class PDFFont {
66
static open(document, src, family, id) {
77
let font;
88

9-
if (src.constructor.name === 'TTFFont') {
10-
font = src;
11-
} else if (typeof src === 'string') {
9+
if (typeof src === 'string') {
1210
if (StandardFont.isStandardFont(src)) {
1311
return new StandardFont(document, src, id);
1412
}
@@ -19,6 +17,8 @@ export class PDFFont {
1917
font = fontkit.create(new Buffer(src), family);
2018
} else if (src instanceof ArrayBuffer) {
2119
font = fontkit.create(new Buffer(new Uint8Array(src)), family);
20+
} else if (typeof src === 'object') {
21+
font = src;
2222
}
2323

2424
if (font == null) {

0 commit comments

Comments
 (0)