use super::types::Float; #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] #[non_exhaustive] pub enum FontStyle { Normal, Oblique, Italic, } impl Default for FontStyle { fn default() -> Self { Self::Normal } } #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] #[non_exhaustive] pub enum FontVariant { Normal, SmallCaps, } impl Default for FontVariant { fn default() -> Self { Self::Normal } } #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] #[non_exhaustive] pub enum FontWeight { Thin, Ultralight, Light, Semilight, Book, Normal, Medium, Semibold, Bold, Ultrabold, Heavy, Ultraheavy, } impl Default for FontWeight { fn default() -> Self { Self::Normal } } #[derive(Clone, Debug)] pub struct FontDescription { pub family: String, pub style: FontStyle, pub weight: FontWeight, // TODO: handles weirdly with bounds that specifies both top and bottom pub size: Float, } // TODO: automate creation of Defined* structs #[derive(Clone, Debug)] pub struct DefinedFontDescription { pub family: String, pub style: FontStyle, pub weight: FontWeight, pub size: f64, } #[derive(Clone, Debug)] pub struct Text { pub content: String, pub font: FontDescription, } #[derive(Clone, Debug)] pub struct DefinedText { pub content: String, pub font: DefinedFontDescription, }