pub enum TextOverflow {
Clip,
Ellipsis,
Visible,
StartEllipsis,
MiddleEllipsis,
ScaleDown {
min_font_size_sp: f32,
},
}Expand description
How overflowing text should be handled.
Variants§
Clip
Text that does not fit is cut off at the bounds of the text.
Ellipsis
The end of the last visible line is replaced with an ellipsis.
Visible
Text is laid out in full and drawn beyond its bounds.
StartEllipsis
The start of the line is replaced with an ellipsis. Takes effect only when max_lines
is 1; otherwise no ellipsis is added.
MiddleEllipsis
The middle of the line is replaced with an ellipsis. Takes effect only when max_lines
is 1; otherwise no ellipsis is added.
ScaleDown
The font size shrinks until the text fits, down to min_font_size_sp. Text that
still overflows at that size is clipped.
Implementations§
Source§impl TextOverflow
impl TextOverflow
Sourcepub fn normalized(self) -> Self
pub fn normalized(self) -> Self
Returns the overflow with the ScaleDown minimum size raised to at least 1.0 sp.
Sourcepub fn scale_down_min_font_size_sp(self) -> Option<f32>
pub fn scale_down_min_font_size_sp(self) -> Option<f32>
Returns the minimum font size of ScaleDown in sp after normalizing, and None for
the other kinds.