pub enum TextAlign {
Start,
End,
Left,
Center,
Right,
Justify,
}Expand description
Paragraph alignment: how each line is positioned within the layout’s width.
Mirrors parley’s Alignment semantics (see parley::layout::Alignment)
without leaking the parley type. Only meaningful when the layout is
wrapped to a max_width (crate::TextContext::layout’s third
argument) — an unbounded layout’s line width already equals its content
width, so every alignment renders identically to TextAlign::Start.
Applies to crate::TextContext::layout only. A live-edited
crate::TextEditor (the engine behind TextInput) does not read this
field — see that type’s docs for why editable text is out of scope.
Variants§
Start
Leading edge of the line’s text direction (left for LTR, right for RTL). Default — matches v1’s hardcoded behavior exactly.
End
Trailing edge of the line’s text direction (right for LTR, left for RTL).
Left
Always the left edge, regardless of text direction.
Center
Each line centered within the layout’s width.
Right
Always the right edge, regardless of text direction.
Justify
Each line except the last is spaced out to fill the layout’s width.