Merge pull request #6090 from Snuffleupagus/issue-6068

Map missing glyphs to the notdef glyph for TrueType (3, 1) fonts (issue 6068)
This commit is contained in:
Jonas Jenwald 2015-06-13 00:29:08 +02:00
commit bf20334bea
4 changed files with 11 additions and 2 deletions

View File

@ -4227,11 +4227,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
}
}
}

View File

@ -137,4 +137,5 @@
!issue5909.pdf
!issue6010_1.pdf
!issue6010_2.pdf
!issue6068.pdf
!issue6081.pdf

BIN
test/pdfs/issue6068.pdf Normal file

Binary file not shown.

View File

@ -1151,6 +1151,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",