|
21 | 21 | fig.text(0.1, 0.9, 'family', fontproperties=heading_font, **alignment) |
22 | 22 | families = ['serif', 'sans-serif', 'cursive', 'fantasy', 'monospace'] |
23 | 23 | for k, family in enumerate(families): |
24 | | - font = FontProperties() |
25 | | - font.set_family(family) |
| 24 | + font = FontProperties(family=[family]) |
26 | 25 | fig.text(0.1, yp[k], family, fontproperties=font, **alignment) |
27 | 26 |
|
28 | 27 | # Show style options |
29 | 28 | styles = ['normal', 'italic', 'oblique'] |
30 | 29 | fig.text(0.3, 0.9, 'style', fontproperties=heading_font, **alignment) |
31 | 30 | for k, style in enumerate(styles): |
32 | | - font = FontProperties() |
33 | | - font.set_family('sans-serif') |
34 | | - font.set_style(style) |
| 31 | + font = FontProperties(family='sans-serif', style=style) |
35 | 32 | fig.text(0.3, yp[k], style, fontproperties=font, **alignment) |
36 | 33 |
|
37 | 34 | # Show variant options |
38 | 35 | variants = ['normal', 'small-caps'] |
39 | 36 | fig.text(0.5, 0.9, 'variant', fontproperties=heading_font, **alignment) |
40 | 37 | for k, variant in enumerate(variants): |
41 | | - font = FontProperties() |
42 | | - font.set_family('serif') |
43 | | - font.set_variant(variant) |
| 38 | + font = FontProperties(family='serif', variant=variant) |
44 | 39 | fig.text(0.5, yp[k], variant, fontproperties=font, **alignment) |
45 | 40 |
|
46 | 41 | # Show weight options |
47 | 42 | weights = ['light', 'normal', 'medium', 'semibold', 'bold', 'heavy', 'black'] |
48 | 43 | fig.text(0.7, 0.9, 'weight', fontproperties=heading_font, **alignment) |
49 | 44 | for k, weight in enumerate(weights): |
50 | | - font = FontProperties() |
51 | | - font.set_weight(weight) |
| 45 | + font = FontProperties(weight=weight) |
52 | 46 | fig.text(0.7, yp[k], weight, fontproperties=font, **alignment) |
53 | 47 |
|
54 | 48 | # Show size options |
55 | 49 | sizes = [ |
56 | 50 | 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large'] |
57 | 51 | fig.text(0.9, 0.9, 'size', fontproperties=heading_font, **alignment) |
58 | 52 | for k, size in enumerate(sizes): |
59 | | - font = FontProperties() |
60 | | - font.set_size(size) |
| 53 | + font = FontProperties(size=size) |
61 | 54 | fig.text(0.9, yp[k], size, fontproperties=font, **alignment) |
62 | 55 |
|
63 | 56 | # Show bold italic |
|
0 commit comments