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
| FlowID | A handle from NewTextFlow. |
|---|---|
| Left | Left edge of the box. |
| Top | Baseline of the first line. |
| Width | Width the text wraps to. |
| Height | How much vertical room the box has. |
Return values
| Count | Lines drawn. |
|---|---|
| 0 | Nothing 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.