pub enum TextWrap {
None,
Word,
Balance,
WordBreak,
Grapheme,
}Variants§
None
Word
Balance
Attempt to balance line breaks for wrapped text.
This is intended to approximate CSS text-wrap: balance / Tailwind text-balance:
keep the same overall wrapping behavior as Word, but avoid a very short last line when
possible.
Note: this is an outcome-driven policy; implementations may use heuristics.
WordBreak
Wrap at word boundaries, but allow breaking long tokens when necessary.
This is similar to CSS overflow-wrap: break-word (with word-break: normal): prefer
wrapping at whitespace/line-break opportunities, but fall back to mid-token breaks when a
single “word” exceeds the available width.
Grapheme
Break between grapheme clusters when needed.
This is intended for editor surfaces (CJK, file paths/URLs, code identifiers) where long “tokens” must still wrap without relying on whitespace or word boundaries.