Text flow within a bounded region, and across several of them.
flow_text/7 fills one box and reports what did not fit. flow_across_boxes/4
threads a single body of text through a list of boxes in order, which is how
multi-column layouts work: each column is a box, and text continues into the
next when one fills.
columns = [{50, 700, 240, 600}, {310, 700, 240, 600}]
{pdf, result} = Box.flow_across_boxes(pdf, rich_text, columns, line_height: 14)
if result.overflow? do
# result.spill_text is what did not fit in any box
endBoxes are {x, y, width, height} in PDF user space, with y at the box's
top edge — text flows downward from there.
Summary
Types
Functions
@spec flow_across_boxes(Tincture.PDF.t(), Tincture.Typography.RichText.t(), [box()], [ option() ]) :: {Tincture.PDF.t(), Tincture.Layout.Box.FlowResult.t()}
@spec flow_text( Tincture.PDF.t(), number(), number(), number(), number(), Tincture.Typography.RichText.t(), [option()] ) :: {Tincture.PDF.t(), Tincture.Typography.LayoutResult.t()}