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:
commit
88e0326787
@ -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;
|
||||
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
@ -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
BIN
test/pdfs/issue6336.pdf
Normal file
Binary file not shown.
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user