Skip to content

ludus::graphics::text

Ludus Wiki · API overview · Browse API

Namespace

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

Functions

AppendText

rhi::RasterStatus ludus::graphics::text::AppendText(renderer::OverlayList &list, const TextQuad *quads, foundation::usize count, foundation::math::Vector2 baseline, foundation::math::Vector4 color, foundation::uint32 width, foundation::uint32 height, const renderer::OverlayStyle &style={}) noexcept
Append copied text quads into the generic overlay list in supplied painter order. Baseline is in physical top-left pixels; no hidden DPI scaling. This validates all quads and available arena/runs before appending; failure preserves geometry. Use the matching published atlas version when preparing the overlay. Empty ink glyphs generate no triangles. All coordinates/colors must be finite.

Related types: renderer::OverlayList · foundation::usize · foundation::uint32 · rhi::RasterStatus · foundation::math::Vector2 · foundation::math::Vector4 · renderer::OverlayStyle · TextQuad

Declared in modules/graphics/text/include/ludus/graphics/text/coverage_atlas.hpp

PrepareText

rhi::RasterStatus ludus::graphics::text::PrepareText(CoverageAtlas &atlas, ludus::text::FontSystem *system, ludus::text::LayoutId layout, foundation::uint64 fontVersion, TextQuad *output, foundation::usize capacity, foundation::usize &count) noexcept
Cold native CPU Text bridge. Copies shaped glyph IDs, 26.6 positions and original clusters; immediately copies FreeType's temporary coverage into GraphicsText's sized cache. Never reshapes, itemizes paragraphs, or retains the FontSystem/layout.
ParameterDescription
atlas
Initialized sized glyph cache receiving copied coverage.
system
Borrowed live native CPU font owner, used only during this call.
layout
Live immutable shaped run in system.
fontVersion
Nonzero content incarnation assigned by the caller; do not reuse after reloading a font or with another FontSystem/font.
output
Caller storage for at least the layout's GlyphCount placements.
capacity
Number of TextQuad entries, bounded by MAX_GLYPHS.
count
Receives complete placement count only on Ready. Output/count stay unchanged on failure; successfully cached glyphs may remain after a later miss fails. Missing glyph IDs rasterize the face's visible .notdef. Atlas pressure is CapacityExceeded; caller can keep its earlier ready label. Native only: browser CPU font dependencies are not yet an engine target. The generic R8 atlas/quad adapter consumes copied CPU fixtures on every backend.

Related types: CoverageAtlas · foundation::uint64 · foundation::usize · rhi::RasterStatus · TextQuad · ludus::text::LayoutId

Declared in modules/graphics/text/include/ludus/graphics/text/text_adapter.hpp