File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -768,22 +768,17 @@ class UnicodeFonts(TruetypeFonts):
768
768
use_cmex = True
769
769
770
770
def __init__ (self , * args , ** kwargs ):
771
- # This must come first so the backend's owner is set correctly
772
771
fallback_rc = rcParams ['mathtext.fallback' ]
773
772
if rcParams ['mathtext.fallback_to_cm' ] is not None :
774
- if rcParams ['mathtext.fallback_to_cm' ]:
775
- fallback_rc = 'cm'
776
- else :
777
- fallback_rc = None
773
+ fallback_rc = ('cm' if rcParams ['mathtext.fallback_to_cm' ]
774
+ else None )
775
+
776
+ font_class = {'stix' : StixFonts ,
777
+ 'stixsans' : StixSansFonts ,
778
+ 'cm' : BakomaFonts
779
+ }.get (fallback_rc )
780
+ self .cm_fallback = font_class (* args , ** kwargs ) if font_class else None
778
781
779
- if fallback_rc == 'stix' :
780
- self .cm_fallback = StixFonts (* args , ** kwargs )
781
- elif fallback_rc == 'stixsans' :
782
- self .cm_fallback = StixSansFonts (* args , ** kwargs )
783
- elif fallback_rc == 'cm' :
784
- self .cm_fallback = BakomaFonts (* args , ** kwargs )
785
- else :
786
- self .cm_fallback = None
787
782
TruetypeFonts .__init__ (self , * args , ** kwargs )
788
783
self .fontmap = {}
789
784
for texfont in "cal rm tt it bf sf" .split ():
You can’t perform that action at this time.
0 commit comments