summaryrefslogtreecommitdiffstats
path: root/winit
diff options
context:
space:
mode:
Diffstat (limited to 'winit')
-rw-r--r--winit/src/application.rs9
-rw-r--r--winit/src/settings.rs4
2 files changed, 12 insertions, 1 deletions
diff --git a/winit/src/application.rs b/winit/src/application.rs
index 8105f8d9..315e34d9 100644
--- a/winit/src/application.rs
+++ b/winit/src/application.rs
@@ -193,7 +193,14 @@ where
};
}
- let (compositor, renderer) = C::new(compositor_settings, Some(&window))?;
+ let (compositor, mut renderer) =
+ C::new(compositor_settings, Some(&window))?;
+
+ for font in settings.fonts {
+ use crate::core::text::Renderer;
+
+ renderer.load_font(font);
+ }
let (mut event_sender, event_receiver) = mpsc::unbounded();
let (control_sender, mut control_receiver) = mpsc::unbounded();
diff --git a/winit/src/settings.rs b/winit/src/settings.rs
index 16c9fcdc..599f33f1 100644
--- a/winit/src/settings.rs
+++ b/winit/src/settings.rs
@@ -33,6 +33,7 @@ use crate::Position;
use winit::monitor::MonitorHandle;
use winit::window::WindowBuilder;
+use std::borrow::Cow;
use std::fmt;
/// The settings of an application.
@@ -52,6 +53,9 @@ pub struct Settings<Flags> {
/// [`Application`]: crate::Application
pub flags: Flags,
+ /// The fonts to load on boot.
+ pub fonts: Vec<Cow<'static, [u8]>>,
+
/// Whether the [`Application`] should exit when the user requests the
/// window to close (e.g. the user presses the close button).
///