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

Map missing glyphs to the notdef glyph for TrueType (3, 1) fonts (issue 6068)

Fixes 6068.

The most notable issue with the font in question is that the `differences` array contains lots of strange entries (of the type `uniXXXX`, instead of proper glyph names).
This commit is contained in:
Jonas Jenwald 2015-06-06 18:00:14 +02:00
parent f943b290e6
commit 5eae3e29c5
4 changed files with 11 additions and 2 deletions

View file

@ -4225,11 +4225,12 @@ var Font = (function FontClosure() {
}
}
if (!found && properties.glyphNames) {
// Try to map using the post table. There are currently no known
// pdfs that this fixes.
// Try to map using the post table.
var glyphId = properties.glyphNames.indexOf(glyphName);
if (glyphId > 0 && hasGlyph(glyphId, -1, -1)) {
charCodeToGlyphId[charCode] = glyphId;
} else {
charCodeToGlyphId[charCode] = 0; // notdef
}
}
}