From cbf4c0393f4296cf24b1898b7f795ee8033f5b11 Mon Sep 17 00:00:00 2001 From: notmasteryet Date: Fri, 30 Dec 2011 19:32:35 -0600 Subject: [PATCH] Replace nbsp entity with character code --- src/canvas.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/canvas.js b/src/canvas.js index 0f7abdddf..a1c4fb40c 100644 --- a/src/canvas.js +++ b/src/canvas.js @@ -711,7 +711,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { width += charWidth; - text.str += glyph.unicode === ' ' ? ' ' : glyph.unicode; + text.str += glyph.unicode === ' ' ? '\u00A0' : glyph.unicode; text.length++; text.canvasWidth += charWidth; } @@ -763,7 +763,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { if (e < 0 && text.geom.spaceWidth > 0) { // avoid div by zero var numFakeSpaces = Math.round(-e / text.geom.spaceWidth); if (numFakeSpaces > 0) { - text.str += ' '; + text.str += '\u00A0'; text.length++; } } @@ -773,7 +773,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() { if (textSelection) { if (shownText.str === ' ') { - text.str += ' '; + text.str += '\u00A0'; } else { text.str += shownText.str; }