Skip to content

Commit

Permalink
Fix fonts not being loaded at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Jun 21, 2024
1 parent 50dd2a6 commit e8b1e5a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion winit/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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,
}
Expand All @@ -253,6 +255,7 @@ where
boot: Some(BootConfig {
proxy,
sender: boot_sender,
fonts: settings.fonts,
window_settings,
graphics_settings,
}),
Expand All @@ -277,6 +280,7 @@ where
let Some(BootConfig {
mut proxy,
sender,
fonts,
window_settings,
graphics_settings,
}) = self.boot.take()
Expand All @@ -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,
Expand Down

0 comments on commit e8b1e5a

Please sign in to comment.