From: Vivien Nicolas <21@vingtetun.org> Date: Thu, 23 Jun 2011 03:38:05 +0000 (+0200) Subject: Use the real content of the string to measure it's size X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=7b454d403bdce69d4be1feeaa59932cf6491bc31;p=pdf.js.git Use the real content of the string to measure it's size --- diff --git a/pdf.js b/pdf.js index 5d9caf4..addcea6 100644 --- 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();