Replace nbsp entity with character code

This commit is contained in:
notmasteryet 2011-12-30 19:32:35 -06:00
parent 877e0f4159
commit cbf4c0393f

View File

@ -711,7 +711,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
width += charWidth; width += charWidth;
text.str += glyph.unicode === ' ' ? ' ' : glyph.unicode; text.str += glyph.unicode === ' ' ? '\u00A0' : glyph.unicode;
text.length++; text.length++;
text.canvasWidth += charWidth; text.canvasWidth += charWidth;
} }
@ -763,7 +763,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
if (e < 0 && text.geom.spaceWidth > 0) { // avoid div by zero if (e < 0 && text.geom.spaceWidth > 0) { // avoid div by zero
var numFakeSpaces = Math.round(-e / text.geom.spaceWidth); var numFakeSpaces = Math.round(-e / text.geom.spaceWidth);
if (numFakeSpaces > 0) { if (numFakeSpaces > 0) {
text.str += '&nbsp;'; text.str += '\u00A0';
text.length++; text.length++;
} }
} }
@ -773,7 +773,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
if (textSelection) { if (textSelection) {
if (shownText.str === ' ') { if (shownText.str === ' ') {
text.str += '&nbsp;'; text.str += '\u00A0';
} else { } else {
text.str += shownText.str; text.str += shownText.str;
} }