added support for add font as Uint8Array

This commit is contained in:
Aaron Fischer 2014-07-29 09:15:39 -07:00
parent e58a7ce809
commit c2c61bb2e2

View File

@ -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.'