@@ -1096,17 +1096,21 @@ function build(opts) {
1096
1096
1097
1097
// font
1098
1098
if ( typeof ctx . font != 'undefined' ) {
1099
- ctx . font = svg . Font . CreateFont (
1100
- this . style ( 'font-style' ) . value ,
1101
- this . style ( 'font-variant' ) . value ,
1102
- this . style ( 'font-weight' ) . value ,
1103
- this . style ( 'font-size' ) . hasValue ( ) ? this . style ( 'font-size' ) . toPixels ( ) + 'px' : '' ,
1104
- this . style ( 'font-family' ) . value ) . toString ( ) ;
1105
-
1106
- // update em size if needed
1107
- var currentFontSize = this . style ( 'font-size' , false , false ) ;
1108
- if ( currentFontSize . isPixels ( ) ) {
1109
- svg . emSize = currentFontSize . toPixels ( ) ;
1099
+ if ( this . style ( 'font' ) . hasValue ( ) ) {
1100
+ ctx . font = this . style ( 'font' ) . value ;
1101
+ } else {
1102
+ ctx . font = svg . Font . CreateFont (
1103
+ this . style ( 'font-style' ) . value ,
1104
+ this . style ( 'font-variant' ) . value ,
1105
+ this . style ( 'font-weight' ) . value ,
1106
+ this . style ( 'font-size' ) . hasValue ( ) ? this . style ( 'font-size' ) . toPixels ( ) + 'px' : '' ,
1107
+ this . style ( 'font-family' ) . value ) . toString ( ) ;
1108
+
1109
+ // update em size if needed
1110
+ var currentFontSize = this . style ( 'font-size' , false , false ) ;
1111
+ if ( currentFontSize . isPixels ( ) ) {
1112
+ svg . emSize = currentFontSize . toPixels ( ) ;
1113
+ }
1110
1114
}
1111
1115
}
1112
1116
0 commit comments