Skip to main content

Module shaped

Module shaped 

Source
Expand description

D4: the shaped-once main-world store.

ShapedText is a per-entity component produced once per change in the main world (see the runtime/layout producer) and read by the editing logic (crate::TextGeometry queries) without any shaper dependency in lumen-input. It also carries the crate::ShapedRun so the render world can eventually consume the same shape via the extract (O1) instead of reshaping; that render-consume step (D4-R) is separable and not yet wired.

Placement note: the doc (section 4.2) sketched ShapedText in lumen-core, but lumen-core must not depend on lumen-text (that would form a cycle: lumen-text already depends on lumen-core). The component therefore lives here in lumen-text, which owns crate::ShapedRun / crate::TextGeometry; every consumer (lumen-input, the layout producer) already depends on lumen-text.

Structs§

ShapedText
One shaped-once result for an entity’s text, produced in the main world.
TextViewport
Companion viewport metrics written by the same producer alongside ShapedText. Keeps TextGeometry a pure byte<->pixel map: the page motion router (D7) reads page_lines = (inner.y / line_h).floor() from here. (D7 itself is deferred, its consumer lives in the locked lumen-runtime, but the producer still populates this so the data is ready.)

Functions§

build_shaped_text
Pure, headless-testable shaping builder (O2): shape display once at size_px under opts, bake the caret metrics, and package the result.