@@ -627,32 +627,33 @@ class FontProperties:
627
627
628
628
- family: A list of font names in decreasing order of priority.
629
629
The items may include a generic font family name, either
630
- 'sans-serif' (default) , 'serif', 'cursive', 'fantasy', or 'monospace'.
630
+ 'sans-serif', 'serif', 'cursive', 'fantasy', or 'monospace'.
631
631
In that case, the actual font to be used will be looked up
632
- from the associated rcParam.
632
+ from the associated rcParam. Default: :rc:`font.family`
633
633
634
- - style: Either 'normal' (default), 'italic' or 'oblique'.
634
+ - style: Either 'normal', 'italic' or 'oblique'.
635
+ Default: :rc:`font.style`
635
636
636
- - variant: Either 'normal' (default) or 'small-caps'.
637
+ - variant: Either 'normal' or 'small-caps'.
638
+ Default: :rc:`font.variant`
637
639
638
640
- stretch: A numeric value in the range 0-1000 or one of
639
641
'ultra-condensed', 'extra-condensed', 'condensed',
640
- 'semi-condensed', 'normal' (default) , 'semi-expanded', 'expanded',
641
- 'extra-expanded' or 'ultra-expanded'.
642
+ 'semi-condensed', 'normal', 'semi-expanded', 'expanded',
643
+ 'extra-expanded' or 'ultra-expanded'. Default: :rc:`font.stretch`
642
644
643
645
- weight: A numeric value in the range 0-1000 or one of
644
- 'ultralight', 'light', 'normal' (default) , 'regular', 'book', 'medium',
646
+ 'ultralight', 'light', 'normal', 'regular', 'book', 'medium',
645
647
'roman', 'semibold', 'demibold', 'demi', 'bold', 'heavy',
646
- 'extra bold', 'black'.
648
+ 'extra bold', 'black'. Default: :rc:`font.weight`
647
649
648
650
- size: Either an relative value of 'xx-small', 'x-small',
649
651
'small', 'medium', 'large', 'x-large', 'xx-large' or an
650
- absolute font size, e.g., 10 (default).
652
+ absolute font size, e.g., 10. Default: :rc:`font.size`
651
653
652
- - math_fontfamily: The family of fonts used to render math text; overrides
653
- :rc:`mathtext.fontset`. Supported values are the same as the ones
654
- supported by :rc:`mathtext.fontset`: 'dejavusans', 'dejavuserif', 'cm',
655
- 'stix', 'stixsans' and 'custom'.
654
+ - math_fontfamily: The family of fonts used to render math text.
655
+ Supported values are: 'dejavusans', 'dejavuserif', 'cm',
656
+ 'stix', 'stixsans' and 'custom'. Default: :rc:`mathtext.fontset`
656
657
657
658
Alternatively, a font may be specified using the absolute path to a font
658
659
file, by using the *fname* kwarg. However, in this case, it is typically
@@ -807,7 +808,7 @@ def set_family(self, family):
807
808
is CSS parlance), such as: 'serif', 'sans-serif', 'cursive',
808
809
'fantasy', or 'monospace', a real font name or a list of real
809
810
font names. Real font names are not supported when
810
- :rc:`text.usetex` is `True`.
811
+ :rc:`text.usetex` is `True`. Default: :rc:`font.family`
811
812
"""
812
813
if family is None :
813
814
family = rcParams ['font.family' ]
@@ -817,7 +818,11 @@ def set_family(self, family):
817
818
818
819
def set_style (self , style ):
819
820
"""
820
- Set the font style. Values are: 'normal', 'italic' or 'oblique'.
821
+ Set the font style.
822
+
823
+ Parameters
824
+ ----------
825
+ style : {'normal', 'italic', 'oblique'}, default: :rc:`font.style`
821
826
"""
822
827
if style is None :
823
828
style = rcParams ['font.style' ]
@@ -826,7 +831,11 @@ def set_style(self, style):
826
831
827
832
def set_variant (self , variant ):
828
833
"""
829
- Set the font variant. Values are: 'normal' or 'small-caps'.
834
+ Set the font variant.
835
+
836
+ Parameters
837
+ ----------
838
+ variant : {'normal', 'small-caps'}, default: :rc:`font.variant`
830
839
"""
831
840
if variant is None :
832
841
variant = rcParams ['font.variant' ]
@@ -838,7 +847,8 @@ def set_weight(self, weight):
838
847
Set the font weight. May be either a numeric value in the
839
848
range 0-1000 or one of 'ultralight', 'light', 'normal',
840
849
'regular', 'book', 'medium', 'roman', 'semibold', 'demibold',
841
- 'demi', 'bold', 'heavy', 'extra bold', 'black'
850
+ 'demi', 'bold', 'heavy', 'extra bold', 'black'.
851
+ Default: :rc:`font.weight`
842
852
"""
843
853
if weight is None :
844
854
weight = rcParams ['font.weight' ]
@@ -857,6 +867,7 @@ def set_stretch(self, stretch):
857
867
'extra-condensed', 'condensed', 'semi-condensed', 'normal',
858
868
'semi-expanded', 'expanded', 'extra-expanded' or
859
869
'ultra-expanded', or a numeric value in the range 0-1000.
870
+ Default: :rc:`font.stretch`
860
871
"""
861
872
if stretch is None :
862
873
stretch = rcParams ['font.stretch' ]
@@ -871,9 +882,14 @@ def set_stretch(self, stretch):
871
882
872
883
def set_size (self , size ):
873
884
"""
874
- Set the font size. Either an relative value of 'xx-small',
875
- 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'
876
- or an absolute font size, e.g., 12.
885
+ Set the font size.
886
+
887
+ Parameters
888
+ ----------
889
+ size : float or {'xx-small', 'x-small', 'small', 'medium', \
890
+ 'large', 'x-large', 'xx-large'}, default: :rc:`font.size`
891
+ If float, the font size in points. The string values denote sizes
892
+ relative to the default font size.
877
893
"""
878
894
if size is None :
879
895
size = rcParams ['font.size' ]
0 commit comments