Skip to main content
Table of Contents

TTMSFNCGraphicsContext.CalculateText Method

Measures the bounding rectangle of AText rendered inside ARect with optional word-wrapping.

API unit family: TMSFNCGraphics Declaring type: TTMSFNCGraphicsContext

Syntax

FMX.TMSFNCGraphics.hppPascalC++
function CalculateText(AText: string; ARect: TRectF; AWordWrapping: Boolean): TRectF; virtual; abstract;
virtual System::Types::TRectF __fastcall CalculateText(System::UnicodeString AText, const System::Types::TRectF &ARect, bool AWordWrapping) = 0;

Parameters

Name Description
AText Text string to measure.
ARect Constraint rectangle that limits available rendering width.
AWordWrapping When True, wraps text at word boundaries within ARect.

Returns

Tightest bounding rectangle enclosing the rendered text.