Skip to main content

Module direction

Module direction 

Source
Expand description

Round 2 (docs/round-2-contract.md §2, direction): direction may sit on ANY node and is inherited; everything direction-dependent reads the NODE’s resolved direction: flex row order, logical insets and paddings, mirrored glyphs and textAlign start/end (the implicit alignment of text is start). Mirrors src/direction.ts; fixtures/text-direction.json locks it. The surface carries the result into crate::style::Visual (direction, text_align) so painters shape text with the node’s direction as the bidi paragraph direction.

Enums§

PhysicalAlign
A physical text alignment.
TextDirection
A text direction.

Functions§

node_directions
Every node’s direction: its own style direction (resolved against ctx when given), else its parent’s; the root’s parent is the surface. Slots inherit from their owner. A template’s items take the direction of the node that renders them.
node_text_align
text_align_of for a reduced node (nodeTextAlign).
physical_text_align
start/end (and an absent or unknown value = start) as the physical side for a direction; left, right, center and justify stay.
text_align_of
A node’s text alignment: its (flattened) style textAlign, else a Text’s align prop, else start, resolved against its direction.