|
|
@ -4130,13 +4130,17 @@ var Font = (function FontClosure() { |
|
|
|
|
|
|
|
|
|
|
|
var charCodeToGlyphId = [], charCode; |
|
|
|
var charCodeToGlyphId = [], charCode; |
|
|
|
var toUnicode = properties.toUnicode, widths = properties.widths; |
|
|
|
var toUnicode = properties.toUnicode, widths = properties.widths; |
|
|
|
var isIdentityUnicode = toUnicode instanceof IdentityToUnicodeMap; |
|
|
|
var skipToUnicode = (toUnicode instanceof IdentityToUnicodeMap || |
|
|
|
|
|
|
|
toUnicode.length === 0x10000); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Helper function to try to skip mapping of empty glyphs.
|
|
|
|
|
|
|
|
// Note: In some cases, just relying on the glyph data doesn't work,
|
|
|
|
|
|
|
|
// hence we also use a few heuristics to fix various PDF files.
|
|
|
|
function hasGlyph(glyphId, charCode, widthCode) { |
|
|
|
function hasGlyph(glyphId, charCode, widthCode) { |
|
|
|
if (!missingGlyphs[glyphId]) { |
|
|
|
if (!missingGlyphs[glyphId]) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!isIdentityUnicode && charCode >= 0 && toUnicode.has(charCode)) { |
|
|
|
if (!skipToUnicode && charCode >= 0 && toUnicode.has(charCode)) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
if (widths && widthCode >= 0 && isNum(widths[widthCode])) { |
|
|
|
if (widths && widthCode >= 0 && isNum(widths[widthCode])) { |
|
|
|