File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ var CharacterStyle = this.CharacterStyle = PathStyle.extend(/** @lends Character
4343 font : 'sans-serif'
4444 } ) ,
4545 _owner : TextItem ,
46- _style : 'style' ,
46+ _style : 'style'
4747
4848 /**
4949 * CharacterStyle objects don't need to be created directly. Just pass an
@@ -74,5 +74,9 @@ var CharacterStyle = this.CharacterStyle = PathStyle.extend(/** @lends Character
7474 // Override leading to return fontSize * 1.2 by default, when undefined
7575 var leading = this . base ( ) ;
7676 return leading != null ? leading : this . getFontSize ( ) * 1.2 ;
77+ } ,
78+
79+ getFontStyle : function ( ) {
80+ return this . _fontSize + 'px ' + this . _font ;
7781 }
7882} ) ;
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ var PointText = this.PointText = TextItem.extend(/** @lends PointText# */{
7272 if ( ! this . _content )
7373 return ;
7474 this . _setStyles ( ctx ) ;
75- ctx . font = this . getFontSize ( ) + 'px ' + this . getFont ( ) ;
75+ ctx . font = style . getFontStyle ( ) ;
7676 ctx . textAlign = this . getJustification ( ) ;
7777 var leading = this . getLeading ( ) ;
7878 for ( var i = 0 , l = this . _lines . length ; i < l ; i ++ ) {
@@ -97,7 +97,7 @@ var PointText = this.PointText = TextItem.extend(/** @lends PointText# */{
9797 x = 0 ;
9898 // Measure the real width of the text. Unfortunately, there is no
9999 // sane way to measure text height with canvas
100- context . font = this . getFontSize ( ) + 'px ' + this . getFont ( ) ;
100+ context . font = this . _style . getFontStyle ( ) ;
101101 var width = 0 ;
102102 for ( var i = 0 , l = this . _lines . length ; i < l ; i ++ )
103103 width = Math . max ( width , context . measureText (
You can’t perform that action at this time.
0 commit comments