[Pkg-javascript-commits] [pdf.js] 81/106: Map missing glyphs to the notdef glyph for TrueType (3, 1) fonts (issue 6068)

David Prévot taffit at moszumanska.debian.org
Sat Jun 20 21:35:10 UTC 2015


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

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

commit 5eae3e29c5800ecbfcf9b741f20e414c360bd0ec
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sat Jun 6 18:00:14 2015 +0200

    Map missing glyphs to the notdef glyph for TrueType (3, 1) fonts (issue 6068)
    
    Fixes 6068.
    
    The most notable issue with the font in question is that the `differences` array contains lots of strange entries (of the type `uniXXXX`, instead of proper glyph names).
---
 src/core/fonts.js       |   5 +++--
 test/pdfs/.gitignore    |   1 +
 test/pdfs/issue6068.pdf | Bin 0 -> 432895 bytes
 test/test_manifest.json |   7 +++++++
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/core/fonts.js b/src/core/fonts.js
index 46535dd..3dd6811 100644
--- a/src/core/fonts.js
+++ b/src/core/fonts.js
@@ -4225,11 +4225,12 @@ var Font = (function FontClosure() {
               }
             }
             if (!found && properties.glyphNames) {
-              // Try to map using the post table. There are currently no known
-              // pdfs that this fixes.
+              // Try to map using the post table.
               var glyphId = properties.glyphNames.indexOf(glyphName);
               if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) {
                 charCodeToGlyphId[charCode] = glyphId;
+              } else {
+                charCodeToGlyphId[charCode] = 0; // notdef
               }
             }
           }
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 4507b6d..721e00f 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -135,4 +135,5 @@
 !issue5909.pdf
 !issue6010_1.pdf
 !issue6010_2.pdf
+!issue6068.pdf
 !issue6081.pdf
diff --git a/test/pdfs/issue6068.pdf b/test/pdfs/issue6068.pdf
new file mode 100644
index 0000000..242d9a9
Binary files /dev/null and b/test/pdfs/issue6068.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 0079ee8..233ab20 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -1137,6 +1137,13 @@
       "rounds": 1,
       "type": "eq"
     },
+    {  "id": "issue6068",
+       "file": "pdfs/issue6068.pdf",
+       "md5": "bbcedb94776b40352729c16940a5b2bd",
+       "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