DrawTextFlow

Text, Fonts

Description

Draws as much of a flow as fits the given box and advances it.

Syntax

Delphi

Function TPDFlib.DrawTextFlow(FlowID: Integer; Left, Top, Width, Height: Double): Integer;

Parameters

FlowIDA handle from NewTextFlow.
LeftLeft edge of the box.
TopBaseline of the first line.
WidthWidth the text wraps to.
HeightHow much vertical room the box has.

Return values

CountLines drawn.
0Nothing fitted, or the handle is not valid.

Remarks

When nothing fits the flow is left exactly as it was, so offering a box too small never loses text and the caller can simply try a larger one.

A single word wider than the box is broken inside the word rather than left unplaceable.

Lines are broken with the font selected when the call is made, so a caller that changes font or size between boxes - or starts a new page without reselecting one - gets different breaks and a different count. Keep the font settings the same across the boxes one flow runs through.

Coordinates read top-down whatever origin is in force, and the font, size and alignment are left as they were.

See also

NewTextFlow, MeasureTextFlow, SetTextFlowMinLines