]> git.parisson.com Git - pdf.js.git/commitdiff
Checking if it's a true symbolic truetype font
authornotmasteryet <async.processingjs@yahoo.com>
Sun, 25 Mar 2012 21:30:44 +0000 (16:30 -0500)
committernotmasteryet <async.processingjs@yahoo.com>
Sun, 25 Mar 2012 21:30:44 +0000 (16:30 -0500)
src/fonts.js
test/pdfs/preistabelle.pdf.link [new file with mode: 0644]
test/test_manifest.json

index 500ef8780c0378098ae1353f1a722309c4ed3990..6ef1970edf74e4f95b2d01976b944ecfeea49c45 100644 (file)
@@ -1958,6 +1958,19 @@ var Font = (function FontClosure() {
           glyphsRemoved++;
         }
 
+        // checking if it's a "true" symbolic font
+        if (this.isSymbolicFont) {
+          var minUnicode = 0xFFFF, maxUnicode = 0;
+          for (var i = 0, ii = glyphs.length; i < ii; i++) {
+            var unicode = glyphs[i].unicode;
+            minUnicode = Math.min(minUnicode, unicode);
+            maxUnicode = Math.max(maxUnicode, unicode);
+          }
+          // high byte must be the same for min and max unicodes
+          if ((maxUnicode & 0xFF00) != (minUnicode & 0xFF00))
+            this.isSymbolicFont = false;
+        }
+
         // heuristics: if removed more than 2 glyphs encoding WinAnsiEncoding
         // does not set properly
         if (glyphsRemoved > 2) {
diff --git a/test/pdfs/preistabelle.pdf.link b/test/pdfs/preistabelle.pdf.link
new file mode 100644 (file)
index 0000000..f48f856
--- /dev/null
@@ -0,0 +1 @@
+http://www.fyve.de/downloads/Preistabelle_FYVE_Oktober_2010.pdf
index 73aa77cd9908d4b7d4757bf336efffb4af44bf28..92b50d9ede894852ba848c939e1ac83ef455e4dd 100644 (file)
       "link": true,
       "type": "eq"
     },
+    {  "id": "preistabelle",
+      "file": "pdfs/preistabelle.pdf",
+      "md5": "d2f0b2086160d4f3d325c79a5dc1fb4d",
+      "rounds": 1,
+      "pageLimit": 2,
+      "link": true,
+      "type": "eq"
+    },
     {  "id": "issue925",
       "file": "pdfs/issue925.pdf",
       "md5": "f58fe943090aff89dcc8e771bc0db4c2",