add patches
This commit is contained in:
parent
a6f4b5ac0a
commit
0ee56eecfb
5 changed files with 189 additions and 0 deletions
43
patches/text.patch
Normal file
43
patches/text.patch
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
--- iced-o/graphics/src/text.rs 2025-04-23 13:38:47.115625021 +0200
|
||||
+++ iced/graphics/src/text.rs 2025-04-23 13:55:27.658385184 +0200
|
||||
@@ -159,16 +159,31 @@
|
||||
static FONT_SYSTEM: OnceLock<RwLock<FontSystem>> = OnceLock::new();
|
||||
|
||||
FONT_SYSTEM.get_or_init(|| {
|
||||
+ #[allow(unused_mut)]
|
||||
+ let mut raw = cosmic_text::FontSystem::new_with_fonts([
|
||||
+ cosmic_text::fontdb::Source::Binary(Arc::new(
|
||||
+ include_bytes!("../fonts/Iced-Icons.ttf").as_slice(),
|
||||
+ )),
|
||||
+ #[cfg(all(target_arch = "wasm32", feature = "fira-sans"))]
|
||||
+ cosmic_text::fontdb::Source::Binary(Arc::new(
|
||||
+ include_bytes!("../fonts/FiraSans-Regular.ttf").as_slice(),
|
||||
+ )),
|
||||
+ ]);
|
||||
+
|
||||
+ // Load system fonts for Android
|
||||
+ // https://github.com/pop-os/cosmic-text/issues/243#issue-2189977938
|
||||
+ #[cfg(target_os = "android")]
|
||||
+ {
|
||||
+ raw.db_mut().load_fonts_dir("/system/fonts");
|
||||
+ raw.db_mut().set_sans_serif_family("Roboto");
|
||||
+ raw.db_mut().set_serif_family("Noto Serif");
|
||||
+ raw.db_mut().set_monospace_family("Droid Sans Mono"); // Cutive Mono looks more printer-like
|
||||
+ raw.db_mut().set_cursive_family("Dancing Script");
|
||||
+ raw.db_mut().set_fantasy_family("Dancing Script");
|
||||
+ }
|
||||
+
|
||||
RwLock::new(FontSystem {
|
||||
- raw: cosmic_text::FontSystem::new_with_fonts([
|
||||
- cosmic_text::fontdb::Source::Binary(Arc::new(
|
||||
- include_bytes!("../fonts/Iced-Icons.ttf").as_slice(),
|
||||
- )),
|
||||
- #[cfg(feature = "fira-sans")]
|
||||
- cosmic_text::fontdb::Source::Binary(Arc::new(
|
||||
- include_bytes!("../fonts/FiraSans-Regular.ttf").as_slice(),
|
||||
- )),
|
||||
- ]),
|
||||
+ raw,
|
||||
loaded_fonts: HashSet::new(),
|
||||
version: Version::default(),
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue