diff --git a/iced_layershell/src/application.rs b/iced_layershell/src/application.rs index 25ba749..bb76297 100644 --- a/iced_layershell/src/application.rs +++ b/iced_layershell/src/application.rs @@ -1,6 +1,6 @@ mod state; -use std::{mem::ManuallyDrop, os::fd::AsFd, sync::Arc, time::Duration}; +use std::{borrow::Cow, mem::ManuallyDrop, os::fd::AsFd, sync::Arc, time::Duration}; use crate::{ actions::{ @@ -195,6 +195,7 @@ where control_sender, state, window, + settings.fonts, )); let mut context = task::Context::from_waker(task::noop_waker_ref()); @@ -331,6 +332,7 @@ async fn run_instance( mut control_sender: mpsc::UnboundedSender>, mut state: State, window: Arc, + fonts: Vec>, ) where A: Application + 'static, E: Executor + 'static, @@ -344,6 +346,10 @@ async fn run_instance( let mut compositor = C::new(compositor_settings, window.clone()) .await .expect("Cannot create compositor"); + for font in fonts { + compositor.load_font(font); + } + let mut renderer = compositor.create_renderer(); let cache = user_interface::Cache::default(); diff --git a/iced_layershell/src/multi_window.rs b/iced_layershell/src/multi_window.rs index 45fe5c0..e5d21e0 100644 --- a/iced_layershell/src/multi_window.rs +++ b/iced_layershell/src/multi_window.rs @@ -8,7 +8,10 @@ use crate::{ settings::VirtualKeyboardSettings, DefaultStyle, }; -use std::{collections::HashMap, f64, mem::ManuallyDrop, os::fd::AsFd, sync::Arc, time::Duration}; +use std::{ + borrow::Cow, collections::HashMap, f64, mem::ManuallyDrop, os::fd::AsFd, sync::Arc, + time::Duration, +}; use crate::{ actions::{LayerShellAction, LayershellCustomActionsWithInfo}, @@ -214,6 +217,7 @@ where event_receiver, control_sender, window, + settings.fonts, is_background_mode, )); @@ -470,6 +474,7 @@ async fn run_instance( >, mut control_sender: mpsc::UnboundedSender>, window: Arc, + fonts: Vec>, is_background_mode: bool, ) where A: Application + 'static, @@ -485,6 +490,9 @@ async fn run_instance( let mut compositor = C::new(compositor_settings, window.clone()) .await .expect("Cannot create compositer"); + for font in fonts { + compositor.load_font(font); + } let mut window_manager = WindowManager::new(); diff --git a/iced_sessionlock/src/multi_window.rs b/iced_sessionlock/src/multi_window.rs index aae174b..8c9aa4a 100644 --- a/iced_sessionlock/src/multi_window.rs +++ b/iced_sessionlock/src/multi_window.rs @@ -3,7 +3,7 @@ use crate::{ actions::{SessionShellActionVec, UnLockAction}, multi_window::window_manager::WindowManager, }; -use std::{collections::HashMap, f64, mem::ManuallyDrop, sync::Arc}; +use std::{borrow::Cow, collections::HashMap, f64, mem::ManuallyDrop, sync::Arc}; use crate::{ actions::SessionShellAction, clipboard::SessionLockClipboard, conversion, error::Error, @@ -177,6 +177,7 @@ where control_sender, //state, window, + settings.fonts, )); let mut context = task::Context::from_waker(task::noop_waker_ref()); @@ -288,6 +289,7 @@ async fn run_instance( >, mut control_sender: mpsc::UnboundedSender, window: Arc, + fonts: Vec>, ) where A: Application + 'static, E: Executor + 'static, @@ -300,7 +302,9 @@ async fn run_instance( let mut compositor = C::new(compositor_settings, window.clone()) .await .expect("Cannot create compositer"); - + for font in fonts { + compositor.load_font(font); + } let mut window_manager = WindowManager::new(); let mut clipboard = SessionLockClipboard::connect(&window);