AggPas - Anti-Grain Geomertry for Object Pascal

TAgg2D.Text(x, y, str, roundOff, ddx, ddy)

Description

Draws a string of text at defined coordinates.

Text is aligned around Text Origin according to TextAlignment settings.

Parameters

x: double

X coordinate of Text Origin [in subpixels].

y: double

Y coordinate of Text Origin [in subpixels].

str: AnsiString

Text to be drawn.

roundOff: boolean = false

Indicates rounding of Text Origin position to the whole numbers.

ddx: double = 0.0

Text Origin position addition after rounding on X axis [in subpixels] (Allows shifting by eg. 0.5 to achieve less blur).

ddy: t2 = 0.0

Text Origin position addition after rounding on Y axis [in subpixels] (Allows shifting by eg. 0.5 to achieve less blur).

Example

if VG.Attach(Image1.Picture.Bitmap) then begin

  VG.ClearAll(255, 255, 255);

  // Font & Colors
  VG.FillColor($00, $00, $8B);
  VG.NoLine;
  VG.TextHints(true);
  VG.Font('Times New Roman', 40.0, false, false, AGG_VectorFontCache);

  // Text
  VG.Text(20, 60, 'TAgg2D Vector Graphics API', true, 0.5, 0.5);

end;

Screenshot: example