Skip to content

Commit

Permalink
Avoid rendering invisible Type3 fonts (issue 5421)
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuffleupagus committed Oct 18, 2014
1 parent 83eff10 commit 4ac4d49
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/display/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions test/pdfs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
!issue5070.pdf
!issue5238.pdf
!issue5244.pdf
!issue5421.pdf
!gradientfill.pdf
!bug903856.pdf
!bug850854.pdf
Expand Down
Binary file added test/pdfs/issue5421.pdf
Binary file not shown.
8 changes: 8 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4ac4d49

Please sign in to comment.