Skip to main content

Module atlas

Module atlas 

Source
Expand description

Atlas text backend (M-TEXT.4 / AUT-78).

AtlasText is the simple/static/performance text path — bitmap font atlases, batchable per-atlas, deterministic, no shaping or BiDi. It preserves the M0.15 bitmap path (scene::Text + text_pipeline) while expressing the same data through the wisp text trait surface (WispTextEngine, WispTextLayout).

For styled, wrapped, or user-typed text use FlexibleText (Cosmic Text + Glyphon, lands in M-TEXT.2/.3). The two backends are complementary, not competitive — see _docs/wisp-book/src/wisp/text/atlas-vs-flexible.md for the comparison table.

Layout semantics:

  • style.size_ndc is the cell side length in NDC. font8x8 cells are square, so glyph width = glyph height = size_ndc.
  • Glyphs advance horizontally by size_ndc + style.letter_spacing_ndc.
  • Newlines (\n) advance the y cursor by size_ndc * style.line_height.
  • style.align shifts whole lines (Left = no shift, Center = (max_w - line_w)/2, Right = max_w - line_w).
  • text.max_width_ndc is ignored by AtlasText (no word wrapping). Captions / soft-wrap belong to FlexibleText.
  • Codepoints absent from the bitmap atlas (anything ≥ 128) are silently dropped — same behavior as the M0.15 scene::Text node.

Structs§

AtlasGlyphInstance
One laid-out glyph — NDC-positioned quad plus atlas UV.
AtlasTextEngine
Bitmap atlas text engine. Wraps a Font (M0.15 8×8 bitmap or any future atlas) and lays out a WispText into per-glyph NDC quads.
AtlasTextLayout
Result of AtlasTextEngine::layout — a flat glyph list plus metrics.

Functions§

layout_atlas 🔒