]> git.parisson.com Git - pdf.js.git/commitdiff
(#919) Fixing toUnicode mapping for TrueType fonts with identity mapping
authornotmasteryet <async.processingjs@yahoo.com>
Sat, 10 Dec 2011 03:21:58 +0000 (21:21 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Sat, 10 Dec 2011 03:21:58 +0000 (21:21 -0600)
src/fonts.js
test/pdfs/issue919.pdf.link [new file with mode: 0644]
test/test_manifest.json

index 8609ae6089992368d06d1280b322584796698237..de8a76dcdaf810b5abaa553ec5ee6be62a4335b8 100644 (file)
@@ -1791,6 +1791,10 @@ var Font = (function FontClosure() {
               var i = unassignedUnicodeItems[j];
               while (unusedUnicode in usedUnicodes)
                 unusedUnicode++;
+              var cid = i + 1;
+              // override only if unicode mapping is not specified
+              if (!(cid in toUnicode))
+                toUnicode[cid] = unusedUnicode;
               glyphs[i].unicode = unusedUnicode++;
             }
             this.useToUnicode = true;
diff --git a/test/pdfs/issue919.pdf.link b/test/pdfs/issue919.pdf.link
new file mode 100644 (file)
index 0000000..6830011
--- /dev/null
@@ -0,0 +1 @@
+http://agb.traviangames.com/Travian_AR_Terms.pdf
index 4d55ac0f7c9f2cb74b212b2ab224d4c3ab35a13e..8e8098317fb50041c41b048afd9c222432866c9e 100644 (file)
        "link": true,
        "pageLimit": 3,
        "type": "eq"
+    },
+    {  "id": "issue919",
+       "file": "pdfs/issue919.pdf",
+       "md5": "3a1716a512aca4d7a8d6106bd4885d14",
+       "rounds": 1,
+       "link": true,
+       "pageLimit": 3,
+       "type": "eq"
     }
 ]