[Pkg-javascript-commits] [pdf.js] 233/246: Fixes Type3 negative font direction
David Prévot
taffit at moszumanska.debian.org
Sun Sep 7 15:36:44 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit be998261cc0c7797a199d3dfd2a7ea03938ddf7b
Author: Yury Delendik <ydelendik at mozilla.com>
Date: Mon Aug 18 17:57:52 2014 -0500
Fixes Type3 negative font direction
---
src/display/canvas.js | 4 ++--
test/pdfs/.gitignore | 1 +
test/pdfs/bug1011159.pdf | Bin 0 -> 18316 bytes
test/test_manifest.json | 8 ++++++++
4 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/display/canvas.js b/src/display/canvas.js
index 3f1fa76..de0a2cc 100644
--- a/src/display/canvas.js
+++ b/src/display/canvas.js
@@ -1473,7 +1473,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
ctx.transform.apply(ctx, current.textMatrix);
ctx.translate(current.x, current.y);
- ctx.scale(textHScale, 1);
+ ctx.scale(textHScale, fontDirection);
for (i = 0; i < glyphsLength; ++i) {
glyph = glyphs[i];
@@ -1503,7 +1503,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
this.restore();
var transformed = Util.applyTransform([glyph.width, 0], fontMatrix);
- width = ((transformed[0] * fontSize + charSpacing) * fontDirection);
+ width = transformed[0] * fontSize + charSpacing;
ctx.translate(width, 0);
current.x += width * textHScale;
diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index bb4f334..4c9ea57 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -38,6 +38,7 @@
!issue3323.pdf
!issue4304.pdf
!issue4550.pdf
+!bug1011159.pdf
!issue4875.pdf
!issue4881.pdf
!rotated.pdf
diff --git a/test/pdfs/bug1011159.pdf b/test/pdfs/bug1011159.pdf
new file mode 100644
index 0000000..0e892a2
Binary files /dev/null and b/test/pdfs/bug1011159.pdf differ
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 607f0cc..13c0762 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -1441,6 +1441,14 @@
"link": true,
"type": "eq"
},
+ { "id": "bug1011159",
+ "file": "pdfs/bug1011159.pdf",
+ "md5": "4532e22deb92d4cd2992d0cfe255582a",
+ "rounds": 1,
+ "lastPage": 1,
+ "type": "eq",
+ "about": "Type3 font with negative HScale and font size"
+ },
{ "id": "bug816075",
"file": "pdfs/bug816075.pdf",
"md5": "7ec87c115c1f9ec41234cc7002555e82",
--
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