From bb2529de039009cb10e4308940f6453fb7f96df0 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Mon, 19 Aug 2013 16:33:20 -0700 Subject: [PATCH 1/2] Move the creation of canvas path fonts to the worker. --- examples/acroforms/index.html | 1 - examples/helloworld/index.html | 1 - make.js | 4 +- src/core/evaluator.js | 38 +++++++++-- src/{display => core}/font_renderer.js | 83 ++++++++++++------------- src/core/fonts.js | 6 +- src/core/worker.js | 1 + src/display/api.js | 16 ++++- src/display/canvas.js | 18 +----- src/display/font_loader.js | 16 +++-- src/shared/util.js | 13 ++++ src/worker_loader.js | 1 + test/pdfs/issue3584.pdf | Bin 0 -> 21424 bytes test/test_manifest.json | 7 +++ test/test_slave.html | 1 - web/viewer.html | 1 - 16 files changed, 131 insertions(+), 76 deletions(-) rename src/{display => core}/font_renderer.js (95%) create mode 100644 test/pdfs/issue3584.pdf diff --git a/examples/acroforms/index.html b/examples/acroforms/index.html index 4e484727b..91094f390 100644 --- a/examples/acroforms/index.html +++ b/examples/acroforms/index.html @@ -13,7 +13,6 @@ - - - - From 60586e31016a2e8d694d47e5bcbbb80e0c1c1943 Mon Sep 17 00:00:00 2001 From: Brendan Dahl Date: Thu, 22 Aug 2013 12:55:43 -0700 Subject: [PATCH 2/2] Ensure there's data to build path. --- src/core/evaluator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 5956c540d..c099fe9d4 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -354,7 +354,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { var glyphs = font.charsToGlyphs(chars); var isAddToPathSet = !!(this.state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG); - if (isAddToPathSet || PDFJS.disableFontFace) { + if (font.data && (isAddToPathSet || PDFJS.disableFontFace)) { for (var i = 0; i < glyphs.length; i++) { if (glyphs[i] === null) { continue;