[Pkg-javascript-commits] [pdf.js] 133/414: Map missing glyphs to the `notdef` glyph for TrueType (3, 1) fonts regardless if the 'post' table is defined or not (issue 6889)

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:14 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 4855d4cc9f367377c6523e3a4fdd4a0c1462d378
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sun Jan 17 22:03:21 2016 +0100

    Map missing glyphs to the `notdef` glyph for TrueType (3, 1) fonts regardless if the 'post' table is defined or not (issue 6889)
---
 src/core/fonts.js       |   6 ++++--
 test/pdfs/.gitignore    |   1 +
 test/pdfs/issue6889.pdf | Bin 0 -> 513863 bytes
 test/test_manifest.json |   7 +++++++
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/core/fonts.js b/src/core/fonts.js
index cdb08c7..b643f8c 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -4362,10 +4362,12 @@ var Font = (function FontClosure() {
               var glyphId = properties.glyphNames.indexOf(glyphName);
               if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) {
                 charCodeToGlyphId[charCode] = glyphId;
-              } else {
-                charCodeToGlyphId[charCode] = 0; // notdef
+                found = true;
               }
             }
+            if (!found) {
+              charCodeToGlyphId[charCode] = 0; // notdef
+            }
           }
         } else if (cmapPlatformId === 0 && cmapEncodingId === 0) {
           // Default Unicode semantics, use the charcodes as is.
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 23b656a..b9ae433 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -202,6 +202,7 @@
 !issue6106.pdf
 !issue6296.pdf
 !issue6298.pdf
+!issue6889.pdf
 !bug1001080.pdf
 !issue6108.pdf
 !issue6113.pdf
diff --git a/test/pdfs/issue6889.pdf b/test/pdfs/issue6889.pdf
new file mode 100644
index 0000000..25d108b
Binary files /dev/null and b/test/pdfs/issue6889.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index f025181..85e8fff 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -1446,6 +1446,13 @@
        "link": false,
        "type": "eq"
     },
+    {  "id": "issue6889",
+       "file": "pdfs/issue6889.pdf",
+       "md5": "397fa92da1a8bfa83dc8c20287854d15",
+       "rounds": 1,
+       "link": false,
+       "type": "eq"
+    },
     {  "id": "tamreview",
       "file": "pdfs/TAMReview.pdf",
       "md5": "8039aba56790d3597d2bc8c794a51301",

-- 
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