Skip to main content

euv_core/style/text_prop/
struct.rs

1use super::*;
2
3/// Typography properties controlling deterministic text layout and glyph rendering.
4#[derive(Clone, Copy, Data, Debug, PartialEq)]
5pub struct TextStyle {
6    /// Semantic font family.
7    #[get(type(copy))]
8    pub(crate) family: FontFamily,
9    /// Font size in logical pixels.
10    #[get(type(copy))]
11    pub(crate) font_size: f32,
12    /// Font weight.
13    #[get(type(copy))]
14    pub(crate) weight: FontWeight,
15    /// Line height multiplier relative to `font_size`.
16    #[get(type(copy))]
17    pub(crate) line_height: f32,
18    /// Extra tracking between characters in logical pixels.
19    #[get(type(copy))]
20    pub(crate) letter_spacing: f32,
21    /// Horizontal alignment.
22    #[get(type(copy))]
23    pub(crate) align: TextAlign,
24    /// Line wrapping / truncation behavior.
25    #[get(type(copy))]
26    pub(crate) overflow: TextOverflow,
27    /// Foreground glyph color.
28    #[get(type(copy))]
29    pub(crate) color: Color,
30    /// Whether text is rendered in italic style.
31    #[get(type(copy))]
32    pub(crate) italic: bool,
33    /// Whether text is underlined.
34    #[get(type(copy))]
35    pub(crate) underline: bool,
36    /// Whether text has strikethrough decoration.
37    #[get(type(copy))]
38    pub(crate) strikethrough: bool,
39}