TTMSFNCGraphics.CalculateTextHeight Method
Returns the rendered height of
ATextin pixels when constrained toARect.
API unit family: TMSFNCGraphics
Declaring type: TTMSFNCGraphics
Overloads
Overload 1
Returns the rendered height of
ATextin pixels when constrained toARect.
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
ATextin 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
ATextin whole pixels when constrained toARect(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.