Skip to main content

ferroui_base/media/
text_alignment.rs

1/// Defines how text is aligned.
2#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
3pub enum TextAlignment {
4    /// The text is left-aligned.
5    #[default]
6    Left,
7    /// The text is centered.
8    Center,
9    /// The text is right-aligned.
10    Right,
11    /// The beginning of the text is aligned to the edge of the available space.
12    Start,
13    /// The end of the text is aligned to the edge of the available space.
14    End,
15    /// Text alignment is inferred from the text content.
16    ///
17    /// When the text alignment is calculated without taking the flow direction
18    /// into account this value is treated as [`TextAlignment::Left`].
19    DetectFromContent,
20    /// Text is justified within the available space.
21    Justify,
22}