1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
//! CSS generic font families (`serif`, `sans-serif`, `monospace`, `cursive`,
//! `fantasy`) and the font family text is shaped with.
use Family;
/// A CSS generic font family. A [`TextStyle::font_family`] (or a canvas
/// font's family) that names one, in any ASCII case (`"monospace"`,
/// `"Monospace"`), asks for the platform's font for it rather than for a
/// font of that name.
///
/// - `monospace`: Consolas, Cascadia Mono or Courier New on Windows; Menlo, Monaco or Courier New on macOS; DejaVu Sans
/// Mono, Noto Sans Mono or Liberation Mono on Linux and other systems.
/// - `serif`: Times New Roman on Windows; Times or Times New Roman on macOS; DejaVu Serif, Noto Serif or Liberation
/// Serif on Linux and other systems.
///
/// The first of these installed is used. With none of them installed,
/// `monospace` draws with the first monospaced font installed and `serif`
/// with the fallback fonts. `sans-serif` draws as the empty family does: in
/// the platform's fallback fonts. `cursive` and `fantasy` ask for the fonts
/// fontdb names (Comic Sans MS; Impact, Papyrus on macOS; fontconfig's choice
/// on Linux) and draw with the fallback fonts where those are not installed.
///
/// The fonts are chosen when the `App` is created (its text engine starts),
/// from the system fonts installed then; fonts the app loads later do not
/// change them. To
/// draw a generic family in a font of the app's own (a bundled monospace
/// font), load it and register an alias of the keyword:
/// `app.register_font("monospace", "JetBrains Mono")`. An alias is resolved
/// before the keyword is read, and the alias of a keyword matches it in any
/// ASCII case.
///
/// [`TextStyle::font_family`]: super::TextStyle::font_family
/// The name a font alias is registered and looked up under: a generic
/// family's keyword in lower case, so `"Monospace"` and `"monospace"` share
/// one alias as they share one font, and any other name as it is.
pub
/// The family text in `family` (a font family name after its alias, if any,
/// is resolved) is shaped with: the generic family a CSS keyword names, the
/// sans-serif family for the empty name, and otherwise the font of that name.
/// Every path that builds shaping attributes or queries faces for a family
/// goes through this, so a name always means the same font.
pub