]> git.parisson.com Git - pdf.js.git/commitdiff
Use the real content of the string to measure it's size
authorVivien Nicolas <21@vingtetun.org>
Thu, 23 Jun 2011 03:38:05 +0000 (05:38 +0200)
committerVivien Nicolas <21@vingtetun.org>
Thu, 23 Jun 2011 03:38:05 +0000 (05:38 +0200)
pdf.js

diff --git a/pdf.js b/pdf.js
index 5d9caf49096762d78b6d268e80b94a171712dee1..addcea6de46cebf4194167d90fa6822293072014 100644 (file)
--- a/pdf.js
+++ b/pdf.js
@@ -2787,7 +2787,9 @@ var CanvasGraphics = (function() {
             this.ctx.transform.apply(this.ctx, this.current.textMatrix);
             this.ctx.scale(1, -1);
             this.ctx.translate(0, -2 * this.current.y);
-            this.ctx.fillText(Fonts.charsToUnicode(text), this.current.x, this.current.y);
+
+            text = Fonts.charsToUnicode(text);
+            this.ctx.fillText(text, this.current.x, this.current.y);
             this.current.x += this.ctx.measureText(text).width;
 
             this.ctx.restore();