@@ -107,6 +107,10 @@ function convertTextStyle(gd, trace) {
107
107
var tfc = textfontIn . color ;
108
108
var tfs = textfontIn . size ;
109
109
var tff = textfontIn . family ;
110
+ var tfw = textfontIn . weight ;
111
+ var tfy = textfontIn . style ;
112
+ var tfh = textfontIn . stretch ;
113
+ var tfv = textfontIn . variant ;
110
114
var optsOut = { } ;
111
115
var i ;
112
116
var plotGlPixelRatio = gd . _context . plotGlPixelRatio ;
@@ -184,7 +188,14 @@ function convertTextStyle(gd, trace) {
184
188
optsOut . color = tfc ;
185
189
}
186
190
187
- if ( isArrayOrTypedArray ( tfs ) || isArrayOrTypedArray ( tff ) ) {
191
+ if (
192
+ isArrayOrTypedArray ( tfs ) ||
193
+ Array . isArray ( tff ) ||
194
+ Array . isArray ( tfw ) ||
195
+ Array . isArray ( tfy ) ||
196
+ Array . isArray ( tfh ) ||
197
+ Array . isArray ( tfv )
198
+ ) {
188
199
// if any textfont param is array - make render a batch
189
200
optsOut . font = new Array ( count ) ;
190
201
for ( i = 0 ; i < count ; i ++ ) {
@@ -197,11 +208,22 @@ function convertTextStyle(gd, trace) {
197
208
) : tfs
198
209
) * plotGlPixelRatio ;
199
210
200
- fonti . family = isArrayOrTypedArray ( tff ) ? tff [ i ] : tff ;
211
+ fonti . family = Array . isArray ( tff ) ? tff [ i ] : tff ;
212
+ fonti . weight = Array . isArray ( tfw ) ? tfw [ i ] : tfw ;
213
+ fonti . style = Array . isArray ( tfy ) ? tfy [ i ] : tfy ;
214
+ fonti . stretch = Array . isArray ( tfh ) ? tfh [ i ] : tfh ;
215
+ fonti . variant = Array . isArray ( tfv ) ? tfv [ i ] : tfv ;
201
216
}
202
217
} else {
203
218
// if both are single values, make render fast single-value
204
- optsOut . font = { size : tfs * plotGlPixelRatio , family : tff } ;
219
+ optsOut . font = {
220
+ size : tfs * plotGlPixelRatio ,
221
+ family : tff ,
222
+ weight : tfw ,
223
+ style : tfy ,
224
+ stretch : tfh ,
225
+ variant : tfv
226
+ } ;
205
227
}
206
228
207
229
return optsOut ;
0 commit comments