pub fn wrap_spans_wordwise(
registry: &GlyphRegistry,
spans: &[Span],
width: usize,
opts: &WrapOpts,
) -> Vec<Vec<Span>>Expand description
Wrap spans word-wise into a sequence of visual lines.
- Word boundaries are whitespace runs.
- Newlines always force a hard line break.
- When
opts.preserve_spacesis false, whitespace is normalized to a single ASCII space and leading spaces at the start of a line are dropped. - When a single token exceeds
widthandopts.hard_break_long_tokensis true, the token is hard-broken by grapheme cluster.