[Pkg-javascript-commits] [pdf.js] 251/414: For CIDFontType2 use CID as glyph ID when missing CID to GID map.

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 6e1d131384f7d218c7f5f73c0d54b1554f529052
Author: Brendan Dahl <brendan.dahl at gmail.com>
Date:   Tue Mar 1 17:05:33 2016 -0800

    For CIDFontType2 use CID as glyph ID when missing CID to GID map.
---
 src/core/fonts.js               |   2 +-
 test/pdfs/.gitignore            |   1 +
 test/pdfs/issue4402_reduced.pdf | Bin 0 -> 22346 bytes
 test/test_manifest.json         |   7 +++++++
 4 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/core/fonts.js b/src/core/fonts.js
index 0c511f8..db379eb 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -2279,7 +2279,7 @@ var Font = (function FontClosure() {
           assert(cid <= 0xffff, 'Max size of CID is 65,535');
           var glyphId = -1;
           if (isCidToGidMapEmpty) {
-            glyphId = charCode;
+            glyphId = cid;
           } else if (cidToGidMap[cid] !== undefined) {
             glyphId = cidToGidMap[cid];
           }
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 911781e..dc72cea 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -67,6 +67,7 @@
 !devicen.pdf
 !cmykjpeg.pdf
 !issue840.pdf
+!issue4402_reduced.pdf
 !issue845r.pdf
 !issue3405r.pdf
 !issue3438.pdf
diff --git a/test/pdfs/issue4402_reduced.pdf b/test/pdfs/issue4402_reduced.pdf
new file mode 100644
index 0000000..bcccd34
Binary files /dev/null and b/test/pdfs/issue4402_reduced.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 1bbc7f0..60b73b9 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -902,6 +902,13 @@
        "rounds": 1,
        "type": "eq"
     },
+    {  "id": "issue4402_reduced",
+       "file": "pdfs/issue4402_reduced.pdf",
+       "md5": "6cc7e61a581889eec3ed7402d87161c4",
+       "link": false,
+       "rounds": 1,
+       "type": "eq"
+    },
     {  "id": "protectip",
        "file": "pdfs/protectip.pdf",
        "md5": "676e7a7b8f96d04825361832b1838a93",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list