Table of Contents

TTMSFNCGraphics.CalculateTextHeight Method

Returns the rendered height of AText in pixels when constrained to ARect.

API unit family: TMSFNCGraphics Declaring type: TTMSFNCGraphics

Overloads

Overload 1

Returns the rendered height of AText in pixels when constrained to ARect.

function CalculateTextHeight(AText: string; ARect: TRectF; AWordWrapping: Boolean = False; ASupportHTML: Boolean = True): Single; overload; virtual;

Parameters

Name Description
AText Text string to measure.
ARect Constraint rectangle that limits the available rendering area.
AWordWrapping When True, wraps text at word boundaries within ARect. Default is False.
ASupportHTML When True, interprets HTML tags in the text. Default is True.

Returns

The rendered height of the text in floating-point pixels.

Overload 2

Returns the single-line rendered height of AText in floating-point pixels using the current font.

function CalculateTextHeight(AText: string): Single; overload; virtual;

Parameters

Name Description
AText Text string to measure.

Returns

The rendered height in floating-point pixels.

Overload 3

Returns the rendered height of AText in whole pixels when constrained to ARect (TRect).

function CalculateTextHeight(AText: string; ARect: TRect; AWordWrapping: Boolean = False; ASupportHTML: Boolean = True): Integer; overload; virtual;

Parameters

Name Description
AText Text string to measure.
ARect Constraint rectangle in integer pixels.
AWordWrapping When True, wraps text at word boundaries within ARect. Default is False.
ASupportHTML When True, interprets HTML tags in the text. Default is True.

Returns

The rendered height of the text in whole pixels.