Sign in Join
FPDoc Onlineexperiment

WordWrap procedure

In unit GraphUtil

Splits the provided string AText at word boundaries to individual lines so that these lines, in pixels, are not longer than the given AMaxWidth.

Declaration

pascal
procedure WordWrap(AFont: TFont; const AText: string; 
 const AMaxWidth: Integer; ALines: TStrings)

Arguments

AFont

Provides the font which will be used for word-wrapping the text.

AText

String which will be wrapped to multiple line when its pixel width is longer than AMaxWidth.

AMaxWidth

Integer argument which defines the maximum width that a line is allowed to have after word-wrapping. The value is specified in pixels.

ALines

This parameter of type TStrings collects the individual lines obtained by word-wrapping the input string.

Description

The procedure WordWrap splits a string at word boundaries so that the separated lines are shorter than the provided AMaxWidth parameter. The individual lines are returned in the list ALines of type TStrings.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.