diff --git a/src/core/fonts.js b/src/core/fonts.js index cdb08c74b..b643f8c18 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 23b656a16..b9ae4339a 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 000000000..25d108b70 Binary files /dev/null and b/test/pdfs/issue6889.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index f02518137..85e8fff1a 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",