diff options
author | 2023-02-24 23:24:48 +0100 | |
---|---|---|
committer | 2023-02-24 23:24:48 +0100 | |
commit | 5100b5d0a1f654ec1254b7765ceadfb9091d6939 (patch) | |
tree | ac33dc79803af7040659380c0c94440b29e93e77 /renderer/src/settings.rs | |
parent | 368cadd25a8b57ee5c41e45d1abe8d1dfb194c69 (diff) | |
download | iced-5100b5d0a1f654ec1254b7765ceadfb9091d6939.tar.gz iced-5100b5d0a1f654ec1254b7765ceadfb9091d6939.tar.bz2 iced-5100b5d0a1f654ec1254b7765ceadfb9091d6939.zip |
Introduce `iced_renderer` subcrate featuring runtime renderer fallback
Diffstat (limited to 'renderer/src/settings.rs')
-rw-r--r-- | renderer/src/settings.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/renderer/src/settings.rs b/renderer/src/settings.rs new file mode 100644 index 00000000..c4dc248b --- /dev/null +++ b/renderer/src/settings.rs @@ -0,0 +1,30 @@ +use crate::{Antialiasing, Font}; + +/// The settings of a [`Backend`]. +/// +/// [`Backend`]: crate::Backend +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct Settings { + /// The default [`Font`] to use. + pub default_font: Font, + + /// The default size of text. + /// + /// By default, it will be set to `16.0`. + pub default_text_size: f32, + + /// The antialiasing strategy that will be used for triangle primitives. + /// + /// By default, it is `None`. + pub antialiasing: Option<Antialiasing>, +} + +impl Default for Settings { + fn default() -> Settings { + Settings { + default_font: Font::SansSerif, + default_text_size: 16.0, + antialiasing: None, + } + } +} |