From RAD Studio API Documentation
Jump to: navigation, search


procedure MeasureText(var ARect: TRectF; const AText: string; const WordWrap: Boolean; const Flags: TFillTextFlags;  const ATextAlign: TTextAlign; const AVTextAlign: TTextAlign = TTextAlign.Center); virtual;


virtual void __fastcall MeasureText(System::Types::TRectF &ARect, const System::UnicodeString AText, const bool WordWrap, const TFillTextFlags Flags, const Fmx::Types::TTextAlign ATextAlign, const Fmx::Types::TTextAlign AVTextAlign = (Fmx::Types::TTextAlign)(0x0));


Type Visibility Source Unit Parent
FMX.Graphics TCanvas


Measures the area occupied by a text string with the specified alignments, flag, and current font, on the TCanvas.

MeasureText is implemented by the TCanvas descendants to determine the rectangle area occupied by a text string with the specified wrapping, alignments, flag, and current font. The string text is framed in a rectangle.

The ARect parameter specifies the maximum size range of the text bounding rectangle. ARect is the return variable. If ARect is not initialized, the returned rectangle is centered in (0,0).

The AText parameter specifies the text to measure.

The WordWrap parameter specifies the word wrapping option. If it is True, it indicates that words are broken across lines to avoid the text overflowing the layout box. If it is set to False, it indicates that words are kept within the same line even when the text overflows the layout box.

The Flags parameter specifies the reading direction of AText.

ATextAlign is the horizontal alignment of the text within ARect.

AVTextAlign is the vertical alignment of the text within ARect. AVTextAlign is optional. By default, it is set to Center.

See Also