diff --git a/src/evaluator.js b/src/evaluator.js index 59fec61a6..e1b63222f 100644 --- a/src/evaluator.js +++ b/src/evaluator.js @@ -528,13 +528,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { var cmd = obj.cmd; switch (cmd) { case 'Tf': - font = handleSetFont(args[0].name); + font = handleSetFont(args[0].name).translated; break; case 'TJ': var items = args[0]; for (var j = 0, jj = items.length; j < jj; j++) { if (typeof items[j] === 'string') { - chunk += items[j]; + chunk += fontCharsToUnicode(items[j], font); } else if (items[j] < 0) { // making all negative offsets a space - better to have // a space in incorrect place than not have them at all @@ -543,17 +543,17 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { } break; case 'Tj': - chunk += args[0]; + chunk += fontCharsToUnicode(args[0], font); break; case "'": - chunk += args[0] + ' '; + chunk += fontCharsToUnicode(args[0], font) + ' '; break; case '"': - chunk += args[2] + ' '; + chunk += fontCharsToUnicode(args[2], font) + ' '; break; } // switch if (chunk !== '') { - text += fontCharsToUnicode(chunk, font.translated); + text += chunk; chunk = ''; } diff --git a/test/test_manifest.json b/test/test_manifest.json index e7575f41f..e8cac9a20 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -83,6 +83,12 @@ "rounds": 1, "type": "load" }, + { "id": "arabiccidtruetype-text", + "file": "pdfs/ArabicCIDTrueType.pdf", + "md5": "d66dbd18bdb572d3ac8b88b32de2ece6", + "rounds": 1, + "type": "text" + }, { "id": "complexttffont-pdf", "file": "pdfs/complex_ttf_font.pdf", "md5": "76de93f9116b01b693bf8583b3e76d91", @@ -275,6 +281,13 @@ "rounds": 1, "type": "eq" }, + { "id": "simpletype3font-text", + "file": "pdfs/simpletype3font.pdf", + "md5": "b374c7543920840c61999e9e86939f99", + "link": false, + "rounds": 1, + "type": "text" + }, { "id": "close-path-bug", "file": "pdfs/close-path-bug.pdf", "md5": "48dd17ef58393857d2d038d33699cac5", diff --git a/web/index.html.template b/web/index.html.template index 44e9a0cbe..a99cf8d14 100644 --- a/web/index.html.template +++ b/web/index.html.template @@ -8,7 +8,8 @@