Skip to content

ludus::text

Ludus Wiki · API overview · Browse API

Namespace

Declared in modules/text/include/ludus/text/font_system.h

Enumerations

Direction

enum class Direction : ludus::foundation::uint8

Related types: ludus::foundation::uint8

LeftToRight

LeftToRight

RightToLeft

RightToLeft

Declared in modules/text/include/ludus/text/font_system.h

Status

enum class Status : ludus::foundation::uint8
Pending denotes staged/asynchronous progress, never success that can be drawn immediately.
Backend/library detail is mapped into these bounded codes.

Related types: ludus::foundation::uint8

Ok

Ok

Pending

Pending

NotReady

NotReady

InvalidArgument

InvalidArgument

InvalidHandle

InvalidHandle

InvalidUtf8

InvalidUtf8

UnsupportedText

UnsupportedText

UnsupportedFont

UnsupportedFont

UnsupportedGlyphFormat

UnsupportedGlyphFormat

UnsupportedPresentation

UnsupportedPresentation

NeedsPreparation

NeedsPreparation

Busy

Busy

ResourceLimit

ResourceLimit

OutOfMemory

OutOfMemory

BackendFailure

BackendFailure

DeviceLost

DeviceLost

Declared in modules/text/include/ludus/text/status.h

Functions

CreateFontSystem

Status ludus::text::CreateFontSystem(const FontSystemConfig &config, FontSystem **outSystem) noexcept
Creates an owned context with all font/layout slot metadata preallocated.
On failure, including OutOfMemory for that metadata, publishes no owner (outSystem = nullptr).

Related types: Status · FontSystemConfig

Declared in modules/text/include/ludus/text/font_system.h

DestroyFontSystem

Status ludus::text::DestroyFontSystem(FontSystem *system) noexcept
Returns Busy if a renderer still references the system.
Safe after partial creation and idempotent for a null pointer.

Related types: Status

Declared in modules/text/include/ludus/text/font_system.h

LoadFont

Status ludus::text::LoadFont(FontSystem *system, std::span< const ludus::foundation::uint8 > bytes, uint32 faceIndex, FontId *outFont) noexcept
Copies bounded bytes and builds a sized-capable outline face plus referenced HarfBuzz font. faceIndex selects a face within a collection.
On failure the output ID is invalid. OutOfMemory (owned byte copy) leaves the system, its counters and every loaded font unchanged.

Related types: ludus::foundation::uint8 · uint32 · Status · FontId

Declared in modules/text/include/ludus/text/font_system.h

UnloadFont

Status ludus::text::UnloadFont(FontSystem *system, FontId font) noexcept
Checks generation and live layouts; returns Busy if referenced, otherwise releases hb/FT objects before the owned bytes.

Related types: Status · FontId

Declared in modules/text/include/ludus/text/font_system.h

GetGlyphCount

Status ludus::text::GetGlyphCount(FontSystem *system, FontId font, uint32 *outCount) noexcept
Number of outline glyphs in the face (for .notdef/bounds diagnostics).

Related types: uint32 · Status · FontId

Declared in modules/text/include/ludus/text/font_system.h

ShapeRun

Status ludus::text::ShapeRun(FontSystem *system, FontId font, std::string_view utf8, const RunSpec &runSpec, LayoutId *outLayout) noexcept
Validates UTF-8 and the run spec, shapes through hb-ft, and owns an immutable layout plus a copy of its source UTF-8.
Empty input is a valid empty layout. A failure, including OutOfMemory for the glyph records, publishes no layout and leaves counters and existing layouts unchanged.

Related types: Status · FontId · LayoutId · RunSpec

Declared in modules/text/include/ludus/text/font_system.h

ShapeLatin

Status ludus::text::ShapeLatin(FontSystem *system, FontId font, std::string_view utf8, uint32 pixelHeight, LayoutId *outLayout) noexcept
Convenience Latin-LTR entry point (script "Latn", language "und").
Never pretends to handle a mixed-script paragraph.

Related types: uint32 · Status · FontId · LayoutId

Declared in modules/text/include/ludus/text/font_system.h

GetLayout

Status ludus::text::GetLayout(FontSystem *system, LayoutId layout, LayoutView *outView) noexcept
Borrows glyph/metric/source views; valid until the layout or system is gone.

Related types: Status · LayoutId · LayoutView

Declared in modules/text/include/ludus/text/font_system.h

DestroyLayout

Status ludus::text::DestroyLayout(FontSystem *system, LayoutId layout) noexcept
Releases owned storage and the font reference; stale IDs return InvalidHandle.

Related types: Status · LayoutId

Declared in modules/text/include/ludus/text/font_system.h

RasterizeGlyph

Status ludus::text::RasterizeGlyph(FontSystem *system, FontId font, uint32 pixelHeight, uint32 glyphId, GlyphBitmap *outBitmap) noexcept
Explicit cold operation.
The borrowed normalized coverage in outBitmap is valid only until the next raster call or system destruction; the caller must copy it immediately. Restores the requested size/load state before rendering. On failure, including OutOfMemory for the scratch coverage, outBitmap stays cleared and RasterizeCalls is not incremented.

Related types: uint32 · Status · FontId · GlyphBitmap

Declared in modules/text/include/ludus/text/font_system.h

GetCounters

FontSystemCounters ludus::text::GetCounters(FontSystem *system) noexcept

Related types: FontSystemCounters

Declared in modules/text/include/ludus/text/font_system.h

IsOk

constexpr bool ludus::text::IsOk(Status status) noexcept

Related types: Status

Declared in modules/text/include/ludus/text/status.h

ToString

const char * ludus::text::ToString(Status status) noexcept
Stable, bounded, human-readable name for diagnostics/logging.
Never throws and never allocates; returns a static string.

Related types: Status

Declared in modules/text/include/ludus/text/status.h

Aliases

float32

using ludus::foundation::core::float32 = float
IEEE binary32 scalar; does not select rounding, trap or denormal policy.

Declared in modules/text/include/ludus/text/font_system.h

int32

using ludus::foundation::core::int32 = std::int32_t
Exact 32-bit signed integer for explicit-width values.

Declared in modules/text/include/ludus/text/font_system.h

uint16

using ludus::foundation::core::uint16 = std::uint16_t
Exact 16-bit unsigned integer for explicit-width values.

Declared in modules/text/include/ludus/text/font_system.h

uint32

using ludus::foundation::core::uint32 = std::uint32_t
Exact 32-bit unsigned integer for explicit-width values.

Declared in modules/text/include/ludus/text/font_system.h

uint64

using ludus::foundation::core::uint64 = std::uint64_t
Exact 64-bit unsigned integer for explicit-width values.

Declared in modules/text/include/ludus/text/font_system.h

usize

using ludus::foundation::core::usize = std::size_t
Native unsigned size/index type; matches sizeof and container sizes, not a wire format.

Declared in modules/text/include/ludus/text/font_system.h