|
@@ -201,7 +201,8 @@ class Text extends Drawable {
|
|
var cc = text.charCodeAt(i);
|
|
var cc = text.charCodeAt(i);
|
|
var e = font.getChar(cc);
|
|
var e = font.getChar(cc);
|
|
var newline = cc == '\n'.code;
|
|
var newline = cc == '\n'.code;
|
|
- var esize = e.width + e.getKerningOffset(prevChar);
|
|
|
|
|
|
+ var offs = e.getKerningOffset(prevChar);
|
|
|
|
+ var esize = e.width + offs;
|
|
// if the next word goes past the max width, change it into a newline
|
|
// if the next word goes past the max width, change it into a newline
|
|
if( font.charset.isBreakChar(cc) && maxWidth != null ) {
|
|
if( font.charset.isBreakChar(cc) && maxWidth != null ) {
|
|
var size = x + esize + letterSpacing;
|
|
var size = x + esize + letterSpacing;
|
|
@@ -220,7 +221,7 @@ class Text extends Drawable {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if( e != null ) {
|
|
if( e != null ) {
|
|
- if( rebuild ) glyphs.add(x, y, e.t);
|
|
|
|
|
|
+ if( rebuild ) glyphs.add(x + offs, y, e.t);
|
|
if( y == 0 && e.t.dy < yMin ) yMin = e.t.dy;
|
|
if( y == 0 && e.t.dy < yMin ) yMin = e.t.dy;
|
|
x += esize + letterSpacing;
|
|
x += esize + letterSpacing;
|
|
}
|
|
}
|