diff options
author | 2023-02-04 07:33:33 +0100 | |
---|---|---|
committer | 2023-02-24 13:28:24 +0100 | |
commit | b29de28d1f0f608f8029c93d154cfd1b0f8b8cbb (patch) | |
tree | e100af1dd98d23b29046bc951b04b440d2aa5bc2 /src | |
parent | a7580e0696a1a0ba76a89db3f78bc99ba3fbb361 (diff) | |
download | iced-b29de28d1f0f608f8029c93d154cfd1b0f8b8cbb.tar.gz iced-b29de28d1f0f608f8029c93d154cfd1b0f8b8cbb.tar.bz2 iced-b29de28d1f0f608f8029c93d154cfd1b0f8b8cbb.zip |
Overhaul `Font` type to allow font family selection
Diffstat (limited to '')
-rw-r--r-- | src/application.rs | 1 | ||||
-rw-r--r-- | src/settings.rs | 18 |
2 files changed, 5 insertions, 14 deletions
diff --git a/src/application.rs b/src/application.rs index 1db5c93f..9a1c1855 100644 --- a/src/application.rs +++ b/src/application.rs @@ -197,7 +197,6 @@ pub trait Application: Sized { let renderer_settings = crate::renderer::Settings { default_font: settings.default_font, default_text_size: settings.default_text_size, - text_multithreading: settings.text_multithreading, antialiasing: if settings.antialiasing { Some(crate::renderer::settings::Antialiasing::MSAAx4) } else { diff --git a/src/settings.rs b/src/settings.rs index 266ad404..ce07b0dd 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -1,5 +1,6 @@ //! Configure your application. use crate::window; +use crate::Font; /// The settings of an application. #[derive(Debug, Clone)] @@ -20,23 +21,16 @@ pub struct Settings<Flags> { /// [`Application`]: crate::Application pub flags: Flags, - /// The bytes of the font that will be used by default. + /// The default [`Font`] to be used. /// - /// If `None` is provided, a default system font will be chosen. - // TODO: Add `name` for web compatibility - pub default_font: Option<&'static [u8]>, + /// By default, it uses [`Font::SansSerif`]. + pub default_font: Font, /// The text size that will be used by default. /// /// The default value is `16.0`. pub default_text_size: f32, - /// If enabled, spread text workload in multiple threads when multiple cores - /// are available. - /// - /// By default, it is disabled. - pub text_multithreading: bool, - /// If set to true, the renderer will try to perform antialiasing for some /// primitives. /// @@ -79,7 +73,6 @@ impl<Flags> Settings<Flags> { window: default_settings.window, default_font: default_settings.default_font, default_text_size: default_settings.default_text_size, - text_multithreading: default_settings.text_multithreading, antialiasing: default_settings.antialiasing, exit_on_close_request: default_settings.exit_on_close_request, try_opengles_first: default_settings.try_opengles_first, @@ -96,9 +89,8 @@ where id: None, window: Default::default(), flags: Default::default(), - default_font: Default::default(), + default_font: Font::SansSerif, default_text_size: 16.0, - text_multithreading: false, antialiasing: false, exit_on_close_request: true, try_opengles_first: false, |