Skip to main content

cranpose_ui/text/
font.rs

1#[derive(Clone, Debug, PartialEq, Eq, Hash)]
2pub struct FontFamily {
3    // Placeholder
4    pub name: String,
5}
6
7impl Default for FontFamily {
8    fn default() -> Self {
9        Self {
10            name: "Default".to_string(),
11        }
12    }
13}
14
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
16pub struct FontWeight(pub u16);
17
18impl FontWeight {
19    pub const THIN: Self = Self(100);
20    pub const EXTRA_LIGHT: Self = Self(200);
21    pub const LIGHT: Self = Self(300);
22    pub const NORMAL: Self = Self(400);
23    pub const MEDIUM: Self = Self(500);
24    pub const SEMI_BOLD: Self = Self(600);
25    pub const BOLD: Self = Self(700);
26    pub const EXTRA_BOLD: Self = Self(800);
27    pub const BLACK: Self = Self(900);
28    pub const W100: Self = Self(100);
29    pub const W200: Self = Self(200);
30    pub const W300: Self = Self(300);
31    pub const W400: Self = Self(400);
32    pub const W500: Self = Self(500);
33    pub const W600: Self = Self(600);
34    pub const W700: Self = Self(700);
35    pub const W800: Self = Self(800);
36    pub const W900: Self = Self(900);
37}
38
39#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
40pub enum FontStyle {
41    #[default]
42    Normal,
43    Italic,
44}
45
46#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
47pub enum FontSynthesis {
48    #[default]
49    None,
50    All,
51    Weight,
52    Style,
53}