summaryrefslogtreecommitdiffstats
path: root/winit
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-06-21 15:38:51 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-06-21 15:38:51 +0200
commite8b1e5a112e7f54689947137932aa18dd46f567a (patch)
tree2e5757c850152a79ddfd82a1bbfceb8c5b8e2a52 /winit
parent50dd2a6cc03fdc184b7a9fb0f7a659952a742a79 (diff)
downloadiced-e8b1e5a112e7f54689947137932aa18dd46f567a.tar.gz
iced-e8b1e5a112e7f54689947137932aa18dd46f567a.tar.bz2
iced-e8b1e5a112e7f54689947137932aa18dd46f567a.zip
Fix fonts not being loaded at startup
Diffstat (limited to 'winit')
-rw-r--r--winit/src/program.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/winit/src/program.rs b/winit/src/program.rs
index 9bb3fa21..d55aedf1 100644
--- a/winit/src/program.rs
+++ b/winit/src/program.rs
@@ -28,6 +28,7 @@ use crate::{Clipboard, Error, Proxy, Settings};
use window_manager::WindowManager;
use rustc_hash::FxHashMap;
+use std::borrow::Cow;
use std::mem::ManuallyDrop;
use std::sync::Arc;
@@ -242,6 +243,7 @@ where
struct BootConfig<Message: 'static, C> {
proxy: Proxy<Message>,
sender: oneshot::Sender<Boot<C>>,
+ fonts: Vec<Cow<'static, [u8]>>,
window_settings: Option<window::Settings>,
graphics_settings: graphics::Settings,
}
@@ -253,6 +255,7 @@ where
boot: Some(BootConfig {
proxy,
sender: boot_sender,
+ fonts: settings.fonts,
window_settings,
graphics_settings,
}),
@@ -277,6 +280,7 @@ where
let Some(BootConfig {
mut proxy,
sender,
+ fonts,
window_settings,
graphics_settings,
}) = self.boot.take()
@@ -298,9 +302,13 @@ where
let clipboard = Clipboard::connect(&window);
let finish_boot = async move {
- let compositor =
+ let mut compositor =
C::new(graphics_settings, window.clone()).await?;
+ for font in fonts {
+ compositor.load_font(font);
+ }
+
sender
.send(Boot {
compositor,