[Pkg-javascript-commits] [pdf.js] 16/56: Fixes spacing in the text layer builder

David Prévot taffit at moszumanska.debian.org
Thu May 15 15:17: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 a468f7215dbc6428d01589f2ecf5595308898a7d
Author: Yury Delendik <ydelendik at mozilla.com>
Date:   Wed Apr 16 11:14:57 2014 -0500

    Fixes spacing in the text layer builder
---
 src/core/evaluator.js | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/core/evaluator.js b/src/core/evaluator.js
index afebf4b..dde570e 100644
--- a/src/core/evaluator.js
+++ b/src/core/evaluator.js
@@ -765,6 +765,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
         for (var i = 0; i < glyphs.length; i++) {
           var glyph = glyphs[i];
           if (!glyph) { // Previous glyph was a space.
+            width += textState.wordSpacing * textState.textHScale;
             continue;
           }
           var vMetricX = null;
@@ -870,10 +871,10 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
                                         args[4], args[5]);
             break;
           case OPS.setCharSpacing:
-            textState.charSpace = args[0];
+            textState.charSpacing = args[0];
             break;
           case OPS.setWordSpacing:
-            textState.wordSpace = args[0];
+            textState.wordSpacing = args[0];
             break;
           case OPS.beginText:
             textState.textMatrix = IDENTITY_MATRIX.slice();
@@ -889,11 +890,12 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
               } else {
                 var val = items[j] / 1000;
                 if (!textState.font.vertical) {
-                  offset = -val * textState.fontSize * textState.textHScale;
+                  offset = -val * textState.fontSize * textState.textHScale *
+                           textState.textMatrix[0];
                   textState.translateTextMatrix(offset, 0);
                   textChunk.width += offset;
                 } else {
-                  offset = -val * textState.fontSize;
+                  offset = -val * textState.fontSize * textState.textMatrix[3];
                   textState.translateTextMatrix(0, offset);
                   textChunk.height += offset;
                 }

-- 
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