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