MeasureTextFlow
Text, Fonts
Description
Reports how many lines the rest of a flow needs at a given width.
Syntax
Delphi
Function TPDFlib.MeasureTextFlow(FlowID: Integer; Width: Double): Integer;Parameters
| FlowID | A handle from NewTextFlow. |
|---|---|
| Width | The width the text would wrap to. |
Return values
| Count | Lines the remaining text needs. |
|---|---|
| 0 | The flow is finished, or the handle is not valid. |
Remarks
Measuring does not consume the flow, so a layout can be sized before it is committed to.
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.