Skip to main content

Module span

Module span 

Source
Expand description

Rich text: a paragraph of independently-styled inline runs.

A Span is one styled run — its text plus an optional color and optional font override. A SpanGroup is a passive widget holding a Vec<Span> that lays the runs out inline, left to right, wrapping to the next line at word boundaries when a run would overflow the arranged width. Each run is painted with its own color and font via Renderer::draw_text.

Wrapping is whitespace-based and works per-character for runs without spaces, using the run font’s fixed character_size (mono fonts only).

Structs§

Span
One styled run of text within a SpanGroup.
SpanGroup
Passive widget laying out a sequence of Span runs inline with word wrapping.