#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct FontHandle(pub usize);
#[derive(Debug, Clone, Copy, PartialEq)]
#[non_exhaustive]
pub struct TextStyle {
pub font: Option<FontHandle>,
pub size: f32,
}
impl Default for TextStyle {
fn default() -> Self {
Self {
font: None,
size: 14.0,
}
}
}
impl TextStyle {
pub fn new(size: f32) -> Self {
Self { font: None, size }
}
pub fn with_font(mut self, font: FontHandle) -> Self {
self.font = Some(font);
self
}
pub fn with_size(mut self, size: f32) -> Self {
self.size = size;
self
}
}