Skip to main content

cranpose_ui/text/
paragraph.rs

1use crate::text::unit::TextUnit;
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
4pub enum TextAlign {
5    #[default]
6    Unspecified, // Kotlin distinction
7    Left,
8    Right,
9    Center,
10    Justify,
11    Start,
12    End,
13}
14
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
16pub enum TextDirection {
17    #[default]
18    Unspecified,
19    Ltr,
20    Rtl,
21    Content,
22}
23
24#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
25pub enum LineBreak {
26    #[default]
27    Unspecified,
28    Simple,
29    Paragraph,
30    Heading,
31}
32
33#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Default)]
34pub enum Hyphens {
35    #[default]
36    Unspecified,
37    None,
38    Auto,
39}
40
41#[derive(Clone, Copy, Debug, PartialEq)]
42pub struct TextIndent {
43    pub first_line: TextUnit,
44    pub rest_line: TextUnit,
45}
46
47impl Default for TextIndent {
48    fn default() -> Self {
49        Self {
50            first_line: TextUnit::Unspecified,
51            rest_line: TextUnit::Unspecified,
52        }
53    }
54}