diff --git a/src/core/fonts.js b/src/core/fonts.js index 46535dd58..3dd6811d5 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 4507b6d40..721e00f93 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 000000000..242d9a964 Binary files /dev/null and b/test/pdfs/issue6068.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 0079ee832..233ab2067 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",