Merge pull request #6337 from Snuffleupagus/issue-6336

Adjust which TrueType (3, 1) glyphs we attempt to skip mapping of (issue 6336)
This commit is contained in:
Brendan Dahl 2015-08-25 09:49:46 -07:00
commit 88e0326787
4 changed files with 15 additions and 3 deletions

View File

@ -4236,9 +4236,10 @@ var Font = (function FontClosure() {
if (!glyphName) {
continue;
}
var unicodeOrCharCode;
var unicodeOrCharCode, isUnicode = false;
if (cmapPlatformId === 3 && cmapEncodingId === 1) {
unicodeOrCharCode = GlyphsUnicode[glyphName];
isUnicode = true;
} else if (cmapPlatformId === 1 && cmapEncodingId === 0) {
// TODO: the encoding needs to be updated with mac os table.
unicodeOrCharCode = Encodings.MacRomanEncoding.indexOf(glyphName);
@ -4246,8 +4247,11 @@ var Font = (function FontClosure() {
var found = false;
for (i = 0; i < cmapMappingsLength; ++i) {
if (cmapMappings[i].charCode === unicodeOrCharCode &&
hasGlyph(cmapMappings[i].glyphId, unicodeOrCharCode, -1)) {
if (cmapMappings[i].charCode !== unicodeOrCharCode) {
continue;
}
var code = isUnicode ? charCode : unicodeOrCharCode;
if (hasGlyph(cmapMappings[i].glyphId, code, -1)) {
charCodeToGlyphId[charCode] = cmapMappings[i].glyphId;
found = true;
break;

View File

@ -95,6 +95,7 @@
!issue5599.pdf
!issue5747.pdf
!issue6099.pdf
!issue6336.pdf
!gradientfill.pdf
!bug903856.pdf
!bug850854.pdf

BIN
test/pdfs/issue6336.pdf Normal file

Binary file not shown.

View File

@ -1200,6 +1200,13 @@
"link": false,
"type": "eq"
},
{ "id": "issue6336",
"file": "pdfs/issue6336.pdf",
"md5": "1c457c12b3606e1de610235d6768bd78",
"rounds": 1,
"link": false,
"type": "eq"
},
{ "id": "issue5801",
"file": "pdfs/issue5801.pdf",
"md5": "e9548650ad40e13e00d2a486bbc2bb1b",