Declarations ​
procedure RenderText(X, Y: TFloat; const Text: string); overload;
procedure RenderText(X, Y: TFloat; const Text: string; Flags: Cardinal); overload;
procedure RenderText(X, Y: TFloat; const Text: string; const Layout: TTextLayout); overload;
procedure RenderText(const DstRect: TFloatRect; const Text: string; Flags: Cardinal); overload;
procedure RenderText(const DstRect: TFloatRect; const Text: string; const Layout: TTextLayout); overload;Overload Details
Overload 1 ​
procedure RenderText(X, Y: TFloat; const Text: string); overload;Renders text at position (X, Y) using default text layout settings.
| Parameter | Type | Description |
|---|---|---|
X, Y | TFloat | Text baseline origin coordinates. |
Text | string | Text string to render. |
Overload 2 ​
procedure RenderText(X, Y: TFloat; const Text: string; Flags: Cardinal); overload;Renders text at position (X, Y) using text alignment flags.
| Parameter | Type | Description |
|---|---|---|
X, Y | TFloat | Text baseline origin coordinates. |
Text | string | Text string to render. |
Flags | Cardinal | Win32 DrawText-compatible formatting flags (e.g., DT_CENTER, DT_VCENTER). |
Overload 3 ​
procedure RenderText(X, Y: TFloat; const Text: string; const Layout: TTextLayout); overload;Renders text at position (X, Y) using a TTextLayout structure.
| Parameter | Type | Description |
|---|---|---|
X, Y | TFloat | Text baseline origin coordinates. |
Text | string | Text string to render. |
Layout | TTextLayout | Text layout configuration. |
Overload 4 ​
procedure RenderText(const DstRect: TFloatRect; const Text: string; Flags: Cardinal); overload;Renders text formatted within destination rectangle DstRect using text formatting flags.
| Parameter | Type | Description |
|---|---|---|
DstRect | TFloatRect | Destination rectangle for text layout and alignment. |
Text | string | Text string to render. |
Flags | Cardinal | Formatting flags controlling text alignment and line wrapping. |
Overload 5 ​
procedure RenderText(const DstRect: TFloatRect; const Text: string; const Layout: TTextLayout); overload;Renders text formatted within destination rectangle DstRect using a TTextLayout structure.
| Parameter | Type | Description |
|---|---|---|
DstRect | TFloatRect | Destination rectangle for text layout and alignment. |
Text | string | Text string to render. |
Layout | TTextLayout | Text layout configuration. |
Description ​
RenderText converts character font outlines into vector path contours and appends them to the active canvas path.
Font outlines are converted using backend text-to-path interfaces (ITextToPathSupport or ITextToPathSupport2) supported by the target Bitmap backend.
The converted glyph contours are drawn using the current canvas brushes and polygon renderer.
Example ​
var
Canvas: TCanvas32;
SolidBrush: TSolidBrush;
begin
Canvas := TCanvas32.Create(MyBitmap);
try
SolidBrush := TSolidBrush(Canvas.Brushes.Add(TSolidBrush));
SolidBrush.FillColor := clBlack32;
// Render text string at coordinate (20, 40)
Canvas.RenderText(20.0, 40.0, 'Hello Graphics32!');
finally
Canvas.Free;
end;
end;