pub enum TextOverflow {
Clip,
Ellipsis,
}Expand description
How text that overflows a bounded [TextContext::layout_bounded]
(max_lines) is handled.
Mirrors Flutter’s TextOverflow.clip/TextOverflow.ellipsis shape (a
deliberately small subset — no fade/visible). Only meaningful
alongside max_lines: with no line cap, neither variant changes
anything (there is nothing to overflow past).
Variants§
Clip
Drop whole lines past max_lines outright; the last visible line’s
own text is left exactly as the line-breaker assigned it, even if it
is itself wider than the box (an unbreakable run with no wrap
opportunity) — Frust does not character-trim in this mode. Default,
and a no-op when max_lines is unset (today’s behavior).
Ellipsis
Same line-dropping as Self::Clip, plus: the last visible line is
character-truncated (UTF-8/char-boundary safe) and has '…'
appended so it fits the layout’s max_width. With an unbounded
max_width, there is no width to truncate against, so the last
visible line’s full text is kept with '…' simply appended.