@@ -21,60 +21,60 @@ def find_matplotlib_font(**kw):
2121        return  FontProperties (fname = path )
2222
2323    from  matplotlib .font_manager  import  FontProperties , findfont 
24-     warnings .filterwarnings ('ignore' ,'findfont: Font family \[\' Foo\' \] ' +  \
24+     warnings .filterwarnings ('ignore' ,  'findfont: Font family \[\' Foo\' \] ' +  \
2525                            'not found. Falling back to .' ,
2626                            UserWarning ,
2727                            module = 'matplotlib.font_manager' )
2828    fig  =  plt .figure ()
29-     ax  =  plt .subplot (  1 , 1 , 1   )
30- 
31-     normalFont  =  find_matplotlib_font (  family   =   "sans-serif" ,
32-                                        style   =   "normal" ,
33-                                        variant   =   "normal" ,
34-                                        size   =   14 ,
35-                                         )
36-     ax .annotate (  "Normal Font" , (0.1 , 0.1 ), xycoords = 'axes fraction' ,
37-                   fontproperties   =   normalFont   )
38- 
39-     boldFont  =  find_matplotlib_font (  family   =   "Foo" ,
40-                                      style   =   "normal" ,
41-                                      variant   =   "normal" ,
42-                                      weight   =   "bold" ,
43-                                      stretch   =   500 ,
44-                                      size   =   14 ,
29+     ax  =  plt .subplot (1 , 1 , 1 )
30+ 
31+     normalFont  =  find_matplotlib_font (family = "sans-serif" ,
32+                                        style = "normal" ,
33+                                        variant = "normal" ,
34+                                        size = 14 ,
35+                                       )
36+     ax .annotate ("Normal Font" , (0.1 , 0.1 ), xycoords = 'axes fraction' ,
37+                   fontproperties = normalFont )
38+ 
39+     boldFont  =  find_matplotlib_font (family = "Foo" ,
40+                                      style = "normal" ,
41+                                      variant = "normal" ,
42+                                      weight = "bold" ,
43+                                      stretch = 500 ,
44+                                      size = 14 ,
4545                                     )
46-     ax .annotate (  "Bold Font" , (0.1 , 0.2 ), xycoords = 'axes fraction' ,
47-                   fontproperties   =   boldFont   )
48- 
49-     boldItemFont  =  find_matplotlib_font (  family   =   "sans serif" ,
50-                                          style   =   "italic" ,
51-                                          variant   =   "normal" ,
52-                                          weight   =   750 ,
53-                                          stretch   =   500 ,
54-                                          size   =   14 ,
46+     ax .annotate ("Bold Font" , (0.1 , 0.2 ), xycoords = 'axes fraction' ,
47+                   fontproperties = boldFont )
48+ 
49+     boldItemFont  =  find_matplotlib_font (family = "sans serif" ,
50+                                          style = "italic" ,
51+                                          variant = "normal" ,
52+                                          weight = 750 ,
53+                                          stretch = 500 ,
54+                                          size = 14 ,
5555                                         )
56-     ax .annotate (  "Bold Italic Font" , (0.1 , 0.3 ), xycoords = 'axes fraction' ,
57-                   fontproperties   =   boldItemFont   )
58- 
59-     lightFont  =  find_matplotlib_font (  family   =   "sans-serif" ,
60-                                       style   =   "normal" ,
61-                                       variant   =   "normal" ,
62-                                       weight   =   200 ,
63-                                       stretch   =   500 ,
64-                                       size   =   14 ,
56+     ax .annotate ("Bold Italic Font" , (0.1 , 0.3 ), xycoords = 'axes fraction' ,
57+                   fontproperties = boldItemFont )
58+ 
59+     lightFont  =  find_matplotlib_font (family = "sans-serif" ,
60+                                       style = "normal" ,
61+                                       variant = "normal" ,
62+                                       weight = 200 ,
63+                                       stretch = 500 ,
64+                                       size = 14 ,
6565                                      )
66-     ax .annotate (  "Light Font" , (0.1 , 0.4 ), xycoords = 'axes fraction' ,
67-                   fontproperties   =   lightFont   )
68- 
69-     condensedFont  =  find_matplotlib_font (  family   =   "sans-serif" ,
70-                                           style   =   "normal" ,
71-                                           variant   =   "normal" ,
72-                                           weight   =   500 ,
73-                                           stretch   =   100 ,
74-                                           size   =   14 ,
66+     ax .annotate ("Light Font" , (0.1 , 0.4 ), xycoords = 'axes fraction' ,
67+                   fontproperties = lightFont )
68+ 
69+     condensedFont  =  find_matplotlib_font (family = "sans-serif" ,
70+                                           style = "normal" ,
71+                                           variant = "normal" ,
72+                                           weight = 500 ,
73+                                           stretch = 100 ,
74+                                           size = 14 ,
7575                                          )
76-     ax .annotate (  "Condensed Font" , (0.1 , 0.5 ), xycoords = 'axes fraction' ,
77-                   fontproperties   =   condensedFont   )
76+     ax .annotate ("Condensed Font" , (0.1 , 0.5 ), xycoords = 'axes fraction' ,
77+                   fontproperties = condensedFont )
7878
7979    ax .set_xticks ([])
8080    ax .set_yticks ([])
@@ -101,6 +101,7 @@ def test_multiline():
101101    ax .set_xticks ([])
102102    ax .set_yticks ([])
103103
104+ 
104105@image_comparison (baseline_images = ['antialiased' ], extensions = ['png' ]) 
105106def  test_antialiasing ():
106107    matplotlib .rcParams ['text.antialiased' ] =  True 
0 commit comments