@@ -681,7 +681,7 @@ def __init__(self,
681
681
fname = None , # if this is set, it's a hardcoded filename to use
682
682
_init = None # used only by copy()
683
683
):
684
- self ._family = None
684
+ self ._family = _normalize_font_family ( rcParams [ 'font.family' ])
685
685
self ._slant = rcParams ['font.style' ]
686
686
self ._variant = rcParams ['font.variant' ]
687
687
self ._weight = rcParams ['font.weight' ]
@@ -820,10 +820,7 @@ def set_family(self, family):
820
820
"""
821
821
if family is None :
822
822
family = rcParams ['font.family' ]
823
- if is_string_like (family ):
824
- family = [six .text_type (family )]
825
- elif not is_string_like (family ) and isinstance (family , Iterable ):
826
- family = [six .text_type (f ) for f in family ]
823
+ family = _normalize_font_family (family )
827
824
self ._family = family
828
825
set_name = set_family
829
826
@@ -967,6 +964,14 @@ def pickle_load(filename):
967
964
return data
968
965
969
966
967
+ def _normalize_font_family (family ):
968
+ if is_string_like (family ):
969
+ family = [six .text_type (family )]
970
+ elif (not is_string_like (family ) and isinstance (family , Iterable )):
971
+ family = [six .text_type (f ) for f in family ]
972
+ return family
973
+
974
+
970
975
class TempCache (object ):
971
976
"""
972
977
A class to store temporary caches that are (a) not saved to disk
0 commit comments