From c2c61bb2e2de520514225e8156e7694806c8e7f0 Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Tue, 29 Jul 2014 09:15:39 -0700 Subject: [PATCH] added support for add font as Uint8Array --- lib/font.coffee | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/font.coffee b/lib/font.coffee index 99544e7..027b408 100644 --- a/lib/font.coffee +++ b/lib/font.coffee @@ -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.'