use super::style::{DefaultTextStyle, TextStyle};
use super::theme::TextTheme;
use crate::tokens::{BuiltinSet, Tokens, TokenTheme};
pub struct TextSettings {
pub theme: Box<dyn TextTheme>,
pub style: Box<dyn TextStyle>,
}
impl Default for TextSettings {
fn default() -> Self {
Self {
theme: Box::new(TokenTheme::new(Tokens::builtin(BuiltinSet::Dark))),
style: Box::new(DefaultTextStyle),
}
}
}
impl TextSettings {
pub fn with_theme(mut self, theme: Box<dyn TextTheme>) -> Self {
self.theme = theme;
self
}
pub fn with_style(mut self, style: Box<dyn TextStyle>) -> Self {
self.style = style;
self
}
}