Merge pull request #6891 from Snuffleupagus/issue-6889

Map missing glyphs to the `notdef` glyph for TrueType (3, 1) fonts regardless if the 'post' table is defined or not (issue 6889)
This commit is contained in:
Yury Delendik 2016-01-20 13:14:47 -06:00
commit 0aa373cdf3
4 changed files with 12 additions and 2 deletions

View File

@ -4370,10 +4370,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.

View File

@ -204,6 +204,7 @@
!issue6106.pdf
!issue6296.pdf
!issue6298.pdf
!issue6889.pdf
!bug1001080.pdf
!issue6108.pdf
!issue6113.pdf

BIN
test/pdfs/issue6889.pdf Normal file

Binary file not shown.

View File

@ -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",