functui.rich_text¶
- class functui.rich_text.Group(segments: tuple[Segment, ...], is_space: bool)[source]¶
Represents a connected span of text, like a word or a space.
- class functui.rich_text.Span(text: tuple[str | Self, ...], rule: functui.classes.StyleRule)[source]¶
- functui.rich_text.TextWrapFunc¶
takes in a line. If line is too long it will be wrapped. New line characters have no effect on the outcome
alias of
Callable[[Iterable[Segment],int,MeasureTextFunc],Iterable[Iterable[Segment]]]
- functui.rich_text.adaptive_text(*string: Span | str, justify=Justify.LEFT, soft_hyphen: str = '-')[source]¶
A data node for text that can be wrapped and styled.
- Parameters:
*string – The text content. Parts of content can be wrapped in a
spanfor styling.justify – Text justification.
soft_hyphen – Display to signal a word being wrapped between to line.