measure

fun measure(node: PdfNode, constraints: Constraints, metrics: FontMetrics): MeasuredNode

Recursive layout pass that turns a PdfNode tree into a MeasuredNode tree.

The pass is single-pass for non-weighted children and two-pass for containers that contain weighted children (weighted { ... }): pass one measures non-weighted children to find the fixed space they consume, pass two distributes the remainder among the weighted siblings proportionally to their weight.

Container nodes (ColumnNode, RowNode) recurse into their children. Leaf nodes (TextNode, SpacerNode, ImageNode) compute their own dimensions directly.