From 7ee894c09cf05054237724ea0557f34589e0c165 Mon Sep 17 00:00:00 2001 From: Julian Viereck <julian.viereck@gmail.com> Date: Thu, 8 Sep 2011 17:23:38 -0700 Subject: [PATCH] fontFile doesn't have to be a FlateStream. complex_ttf_font.pdf --- worker.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/worker.js b/worker.js index b71f1a878..c0cf7c29d 100644 --- a/worker.js +++ b/worker.js @@ -139,7 +139,15 @@ var WorkerPDFDoc = (function() { var fontFile = new Stream(font.file.bytes, font.file.start, font.file.end - font.file.start, fontFileDict); - font.file = new FlateStream(fontFile); + + // Check if this is a FlateStream. Otherwise just use the created + // Stream one. This makes complex_ttf_font.pdf work. + var cmf = font.file.bytes[0]; + if ((cmf & 0x0f) == 0x08) { + font.file = new FlateStream(fontFile); + } else { + font.file = fontFile; + } } var images = data.images;