Skip to main content

Module text_renderer

Module text_renderer 

Source
Expand description

Text layout and rendering — monospace glyph sequences with rich text support.

TextBlock lays out a string as a grid of per-character glyphs in world or screen space. Rich text markup [color:r,g,b]text[/color] is supported for color changes mid-string. A typewriter effect is built in.

Structs§

CharLayout
A single character’s layout result.
Marquee
Horizontally scrolling marquee text.
ScrollingText
A scrolling text display — think: terminal output, combat log, news ticker.
TextBlock
A laid-out block of text. Position is the top-left corner in world/screen space.
TextSpan
A run of text with uniform style.
TypewriterBlock
A TextBlock with a typewriter reveal effect.

Enums§

TextAlign
TextBaseline

Functions§

parse_rich_text
Parses a simple markup string into a list of TextSpans.
wrap_text
Word-wrap text to at most max_chars per line.