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§
- Shaped
Text - One shaped-once result for an entity’s text, produced in the main world.
- Text
Viewport - Companion viewport metrics written by the same producer alongside
ShapedText. KeepsTextGeometrya pure byte<->pixel map: the page motion router (D7) readspage_lines = (inner.y / line_h).floor()from here. (D7 itself is deferred, its consumer lives in the lockedlumen-runtime, but the producer still populates this so the data is ready.)
Functions§
- build_
shaped_ text - Pure, headless-testable shaping builder (O2): shape
displayonce atsize_pxunderopts, bake the caret metrics, and package the result.