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

Merge pull request #5901 from Snuffleupagus/bug-1050040

Fall back to the |defaultEncoding| when no valid "post" table is found in TrueType fonts (bug 1050040)
This commit is contained in:
Tim van der Meij 2015-05-15 12:54:04 +02:00
commit 7da9626d16
4 changed files with 15 additions and 2 deletions

View file

@ -3250,7 +3250,10 @@ var Font = (function FontClosure() {
}
}
if (!potentialTable) {
if (potentialTable) {
font.pos = start + potentialTable.offset;
}
if (!potentialTable || font.peekByte() === -1) {
warn('Could not find a preferred cmap table.');
return {
platformId: -1,
@ -3260,7 +3263,6 @@ var Font = (function FontClosure() {
};
}
font.pos = start + potentialTable.offset;
var format = font.getUint16();
var length = font.getUint16();
var language = font.getUint16();
@ -3695,6 +3697,9 @@ var Font = (function FontClosure() {
default:
warn('Unknown/unsupported post table version ' + version);
valid = false;
if (properties.defaultEncoding) {
glyphNames = properties.defaultEncoding;
}
break;
}
properties.glyphNames = glyphNames;