]> git.parisson.com Git - pdf.js.git/commitdiff
fontFile doesn't have to be a FlateStream. complex_ttf_font.pdf
authorJulian Viereck <julian.viereck@gmail.com>
Fri, 9 Sep 2011 00:23:38 +0000 (17:23 -0700)
committerJulian Viereck <julian.viereck@gmail.com>
Thu, 15 Sep 2011 16:03:51 +0000 (09:03 -0700)
worker.js

index b71f1a878b10f1009790643a96078475315e24b6..c0cf7c29d155cd0c60e8893e8e0174c164e01940 100644 (file)
--- 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;