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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
//! Bundled Material typography fonts: the raw variable-TTF bytes for Roboto
//! Flex and Roboto Mono, embedded via `include_bytes!` so [`install`](crate::install)
//! can register them with no filesystem or network access at runtime.
//!
//! - **Roboto Flex Variable** (upright) — Google Fonts, OFL-1.1. The sans face
//! the whole catalog's display/heading/body text resolves to
//! ([`type_scale`](super::type_scale)).
//! - **Roboto Mono Variable** (upright) — Google Fonts, OFL-1.1 (verified from
//! the shipped font's own `name` table, nameID 13/14). The monospace face
//! for `kbd`, code, and tabular figures (currently unused by the catalog;
//! available for components that need mono text).
//!
//! Both are *variable* fonts, so one file per family covers the whole weight
//! range the catalog names instead of one file per weight.
//!
//! Provenance (exact upstream releases/URLs, retrieval date, per-face sizes,
//! SHA-256) is recorded in `plugins/material/FONTS-LICENSE`, alongside the
//! full license text for each family (`fonts/roboto-flex/OFL.txt`,
//! `fonts/roboto-mono/OFL.txt`) — required by the OFL-1.1 license-inclusion
//! term. Neither font declares a Reserved Font Name.
//!
//! Roboto Mono ships the upstream bytes unmodified. **Roboto Flex does not**:
//! it is a `wght`-only static-axis instance of the upstream 13-axis variable
//! font, regenerated by `scripts/fonts/instance_variable_font.py`
//! (`FONTS-LICENSE`'s "Modification" record has the exact command, upstream
//! and instanced SHA-256, and date). Only `wght` is ever driven — the only
//! styling `crates/frust-text` applies to a shaped run is
//! `StyleProperty::FontWeight`/`FontStyle`, and no component anywhere
//! requests `opsz`, `wdth`, `GRAD`, `slnt`, or any of Roboto Flex's eight
//! parametric axes — so pinning those twelve axes at their upstream default
//! values drops their `gvar` deltas with no visual change, while every glyph
//! stays (no subsetting). Regenerate the instance (from a fresh upstream
//! download, with an added `--keep <axis>` per axis to keep) if the text
//! stack ever starts requesting one of those axes, e.g. an optical-size
//! (`opsz`) or width (`wdth`) style property.
//!
//! The bytes are gated behind the crate's `bundled-fonts` feature (default
//! on): with it off, [`font_data`] returns an empty slice and neither face is
//! compiled into the binary, so an app that ships its own fonts or accepts
//! the platform's system sans can drop the bundled bytes entirely.
//!
//! This module stays pure-data: [`font_data`] only returns bytes. Registering
//! them into a live `TextContext` (and forcing the relayout
//! `TextContext::register_fonts`'s contract requires) is a shell's job —
//! [`install`](crate::install) hands them to `frust::register_app_fonts`, and
//! each shell drains that queue into its own `TextContext`.
/// Roboto Flex Variable, upright (font version `3.200;gftools[0.9.32]`,
/// OFL-1.1, © 2017 The Roboto Flex Project Authors). See
/// `fonts/roboto-flex/OFL.txt`.
const ROBOTO_FLEX_VARIABLE: & = include_bytes!;
/// Roboto Mono Variable, upright (Google Fonts, OFL-1.1). See
/// `fonts/roboto-mono/OFL.txt`.
const ROBOTO_MONO_VARIABLE: & = include_bytes!;
/// Index of the Roboto Flex face in [`font_data`]'s array — the face
/// [`native_typefaces`](super::native_typefaces) binds into both native
/// slots. Named rather than spelled `0` inline because a native host's publish
/// guard de-duplicates by byte *identity*: the face this index selects and the
/// one `font_data()` hands a shell must be the same `&'static [u8]`.
///
/// Public because a host that registers the faces itself (rather than through
/// [`install`](crate::install)) needs to name which is which.
pub const ROBOTO_FLEX_VARIABLE_INDEX: usize = 0;
/// Index of the Roboto Mono face in [`font_data`]'s array. See
/// [`ROBOTO_FLEX_VARIABLE_INDEX`].
pub const ROBOTO_MONO_VARIABLE_INDEX: usize = 1;
/// Every bundled Material font face's raw bytes (2 faces: Roboto Flex Variable,
/// then Roboto Mono Variable), in no particular registration order — fontique
/// groups registered faces by the family name each face's own `name` table
/// carries, so a caller can register them in any order, one at a time or all at
/// once.
///
/// The two `*_INDEX` constants above are the one place this order is
/// load-bearing; keep them in step with the array literal below.
///
/// Returns an empty slice with the `bundled-fonts` feature off — see the
/// module doc.
/// See the feature-on [`font_data`] above; with `bundled-fonts` off there are
/// no bytes to hand out.