1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-23 00:28:06 +02:00

Merge pull request #885 from notmasteryet/issue-884

(#884) Use unicode mapping cmap when simple identity cmap was originally used
This commit is contained in:
Artur Adib 2011-12-06 11:59:07 -08:00
commit 9eae90a1ba
3 changed files with 13 additions and 1 deletions

View file

@ -1758,7 +1758,7 @@ var Font = (function Font() {
var hasShortCmap = !!cmapTable.hasShortCmap;
var toUnicode = this.toUnicode;
if (hasShortCmap && toUnicode) {
if (toUnicode) {
// checking if cmap is just identity map
var isIdentity = true;
for (var i = 0, ii = glyphs.length; i < ii; i++) {
@ -2110,6 +2110,10 @@ var Font = (function Font() {
unicode = charcode;
break;
case 'TrueType':
if (this.useToUnicode) {
unicode = this.toUnicode[charcode] || charcode;
break;
}
var glyphName = this.differences[charcode] || this.encoding[charcode];
if (!glyphName)
glyphName = Encodings.StandardEncoding[charcode];