width += charWidth;
- text.str += glyph.unicode === ' ' ? ' ' : glyph.unicode;
+ text.str += glyph.unicode === ' ' ? '\u00A0' : glyph.unicode;
text.length++;
text.canvasWidth += charWidth;
}
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++;
}
}
if (textSelection) {
if (shownText.str === ' ') {
- text.str += ' ';
+ text.str += '\u00A0';
} else {
text.str += shownText.str;
}