Table of Contents

ITMSFNCCustomPDFGraphicsLib.DrawText Method

Draws plain text across the specified number of columns within a rectangle and returns the overflow character count.

API unit family: TMSFNCPDFGraphicsLib Declaring type: ITMSFNCCustomPDFGraphicsLib

Overloads

Overload 1

Draws plain text across the specified number of columns within a rectangle and returns the overflow character count.

function DrawText(Text: UnicodeString; Rect: TRectF; Columns: Integer; Padding: Single = 5.0; DetectOverflow: Boolean = False): Integer; overload;

Parameters

Name Description
Text Plain text to render.
Rect Bounding rectangle for all columns combined in PDF coordinate units.
Columns Number of equal-width columns to flow the text through.
Padding Gap between adjacent columns in PDF coordinate units.
DetectOverflow When True, stops drawing at the last fitted character and returns the overflow count.

Returns

Number of characters that did not fit; 0 means all text was drawn.

Overload 2

Draws plain text across the specified array of rectangles and returns the overflow character count.

function DrawText(Text: UnicodeString; Rects: TTMSFNCPDFGraphicsLibRectArray; Padding: Single = 5.0; DetectOverflow: Boolean = False): Integer; overload;

Parameters

Name Description
Text Plain text to render.
Rects Array of target rectangles in PDF coordinate units; text flows from one to the next.
Padding Gap between adjacent columns in PDF coordinate units.
DetectOverflow When True, stops drawing at the last fitted character and returns the overflow count.

Returns

Number of characters that did not fit; 0 means all text was drawn.

Overload 3

Draws plain text starting at the specified point and returns its bounding rectangle.

function DrawText(Text: UnicodeString; Point: TPointF; Calculate: Boolean = False): TRectF; overload;

Parameters

Name Description
Text Plain text to render.
Point Top-left position of the text in PDF coordinate units.
Calculate When True, measures the text without drawing it.

Returns

Bounding rectangle of the rendered or measured text.

Overload 4

Draws plain text within the specified rectangle and returns its bounding rectangle.

function DrawText(Text: UnicodeString; Rect: TRectF; Calculate: Boolean = False): TRectF; overload;

Parameters

Name Description
Text Plain text to render.
Rect Bounding rectangle for the text layout in PDF coordinate units.
Calculate When True, measures the text without drawing it.

Returns

Bounding rectangle of the rendered or measured text.