Commit d88f910
Update to cosmic-text 0.15 (bevyengine#21699)
# Objective
Update `bevy_text`'s cosmic-text dependency to 0.15
Fixes bevyengine#21766
## Solution
Very minimal changes here, nothing user facing except an error return
type.
* Cosmic-text no longer uses `ttf_parser`, so, to validate fonts during
asset loading, a `skrifa::FontRef` is constructed instead. If the font
is invalid, the font asset loader now returns a `skrifa::ReadError`, not
a `ttf_parser::FaceParsingError`.
* To get a font from the global `CosmicFontSystem` instance, the
`get_font` function requires a weight now. The weight is looked up from
the `CosmicFontSystems` font database, immediately before the `get_font`
call.
The changes here are a little hackish, but that's a symptom of our lack
of support for font collections.
Co-authored-by: François Mockers <[email protected]>1 parent 2668d06 commit d88f910
File tree
4 files changed
+13
-8
lines changed- crates/bevy_text
- src
4 files changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
314 | 319 | | |
315 | 320 | | |
316 | 321 | | |
| |||
0 commit comments