Support units other than 'px' in CharacterStyle#fontSize, but default to 'px' if no unit is specified.

This commit is contained in:
Jürg Lehni 2013-02-14 20:23:13 -08:00
parent 701c5fd9e7
commit 8bdcbe1777

View file

@ -78,6 +78,7 @@ var CharacterStyle = this.CharacterStyle = PathStyle.extend(/** @lends Character
},
getFontStyle: function() {
return this._fontSize + 'px ' + this._font;
var size = this._fontSize;
return (/[a-z]/i.test(size) ? size + ' ' : size + 'px ') + this._font;
}
});