mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Merge pull request #257 from pretzelfisch/master
added support for add font as Uint8Array
This commit is contained in:
commit
314e9d28ae
@ -33,6 +33,11 @@ class PDFFont
|
||||
@font = TTFFont.fromBuffer src, family
|
||||
@subset = new Subset @font
|
||||
@registerTTF()
|
||||
|
||||
else if src instanceof Uint8Array
|
||||
@font = TTFFont.fromBuffer (new Buffer src), family
|
||||
@subset = new Subset @font
|
||||
@registerTTF()
|
||||
|
||||
else
|
||||
throw new Error 'Not a supported font format or standard PDF font.'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user