iced_tiny_skia/
settings.rs

1use crate::core::{Font, Pixels};
2use crate::graphics;
3
4/// The settings of a [`Compositor`].
5///
6/// [`Compositor`]: crate::window::Compositor
7#[derive(Debug, Clone, Copy, PartialEq)]
8pub struct Settings {
9    /// The default [`Font`] to use.
10    pub default_font: Font,
11
12    /// The default size of text.
13    ///
14    /// By default, it will be set to `16.0`.
15    pub default_text_size: Pixels,
16}
17
18impl Default for Settings {
19    fn default() -> Settings {
20        Settings {
21            default_font: Font::default(),
22            default_text_size: Pixels(16.0),
23        }
24    }
25}
26
27impl From<graphics::Settings> for Settings {
28    fn from(settings: graphics::Settings) -> Self {
29        Self {
30            default_font: settings.default_font,
31            default_text_size: settings.default_text_size,
32        }
33    }
34}