1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Adjust which TrueType (3, 1) glyphs we attempt to skip mapping of (issue 6336)

Fixes 6336.
This commit is contained in:
Jonas Jenwald 2015-08-09 12:31:05 +02:00
parent 26b9205c7e
commit 99d29487ab
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;