[Pkg-javascript-commits] [pdf.js] 09/139: Avoid rendering invisible Type3 fonts (issue 5421)

David Prévot taffit at moszumanska.debian.org
Fri Jan 9 21:18:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 4ac4d49158fa940bb0a45b2532d81a674cb1217c
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sat Oct 18 22:29:21 2014 +0200

    Avoid rendering invisible Type3 fonts (issue 5421)
---
 src/display/canvas.js   |   4 +++-
 test/pdfs/.gitignore    |   1 +
 test/pdfs/issue5421.pdf | Bin 0 -> 3209 bytes
 test/test_manifest.json |   8 ++++++++
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/display/canvas.js b/src/display/canvas.js
index de0a2cc..5f03e64 100644
--- a/src/display/canvas.js
+++ b/src/display/canvas.js
@@ -1463,9 +1463,11 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
       var textHScale = current.textHScale * fontDirection;
       var fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;
       var glyphsLength = glyphs.length;
+      var isTextInvisible =
+        current.textRenderingMode === TextRenderingMode.INVISIBLE;
       var i, glyph, width;
 
-      if (fontSize === 0) {
+      if (isTextInvisible || fontSize === 0) {
         return;
       }
 
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index 2e34a2b..244481a 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -65,6 +65,7 @@
 !issue5070.pdf
 !issue5238.pdf
 !issue5244.pdf
+!issue5421.pdf
 !gradientfill.pdf
 !bug903856.pdf
 !bug850854.pdf
diff --git a/test/pdfs/issue5421.pdf b/test/pdfs/issue5421.pdf
new file mode 100644
index 0000000..f288a71
Binary files /dev/null and b/test/pdfs/issue5421.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 4d21659..5032a01 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -1555,6 +1555,14 @@
       "type": "eq",
       "about": "True type font with encoding dict with no base encoding but with differences."
     },
+    {  "id": "issue5421",
+       "file": "pdfs/issue5421.pdf",
+       "md5": "273f6813758a2349090003c7c8a0d85e",
+       "link": false,
+       "rounds": 1,
+       "type": "eq",
+       "about": "Invisible Type3 font used for text selection and searching."
+    },
     {  "id": "issue5280",
       "file": "pdfs/issue5280.pdf",
       "md5": "0ea1230e2964e74cb6db063a89b78803",

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list