Browse Source

Merge pull request #885 from notmasteryet/issue-884

(#884) Use unicode mapping cmap when simple identity cmap was originally used
Artur Adib 14 years ago
parent
commit
9eae90a1ba
  1. 6
      src/fonts.js
  2. 1
      test/pdfs/tutorial.pdf.link
  3. 7
      test/test_manifest.json

6
src/fonts.js

@ -1758,7 +1758,7 @@ var Font = (function Font() { @@ -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() { @@ -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];

1
test/pdfs/tutorial.pdf.link

@ -0,0 +1 @@ @@ -0,0 +1 @@
http://cplusplus.com/files/tutorial.pdf

7
test/test_manifest.json

@ -295,5 +295,12 @@ @@ -295,5 +295,12 @@
"md5": "20d88011dd7e3c4fb5274979094dab93",
"rounds": 1,
"type": "eq"
},
{ "id": "tutorial",
"file": "pdfs/tutorial.pdf",
"md5": "6e122f618c27f3aa9a689423e3be6b8d",
"link": true,
"rounds": 1,
"type": "eq"
}
]

Loading…
Cancel
Save