2023-08-30 04:31:21 +02:00
|
|
|
use crate::core::{Font, Pixels};
|
2023-03-04 05:37:11 +01:00
|
|
|
use crate::graphics::Antialiasing;
|
2023-02-24 23:24:48 +01:00
|
|
|
|
2023-09-09 12:24:47 +02:00
|
|
|
/// The settings of a Backend.
|
2023-02-24 23:24:48 +01:00
|
|
|
#[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`.
|
2023-08-30 04:31:21 +02:00
|
|
|
pub default_text_size: Pixels,
|
2023-02-24 23:24:48 +01:00
|
|
|
|
|
|
|
|
/// 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 {
|
2023-03-30 00:56:00 +02:00
|
|
|
default_font: Font::default(),
|
2023-08-30 04:31:21 +02:00
|
|
|
default_text_size: Pixels(16.0),
|
2023-02-24 23:24:48 +01:00
|
|
|
antialiasing: None,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|