mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 00:28:06 +02:00
Use unicode mapping cmap when simple identity cmap was originally used
This commit is contained in:
parent
759e839c42
commit
b8a5d6b8a7
3 changed files with 13 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue