FMX TPaintBox Canvas.FillText not working as exspected on Windows 10


I have a multi device application with fmx. On Form1 there is only a TPaintBox named pbox. In pboxPaint I do all drawing. With Bitmaps it functions better and faster than exspected! (Good for game developers, more advertising would help to kick off older bad working solutions). But with Canvas.FillText there are several errors.

Horizontal alignment is wrong. TTextAlign.Leading aligns text to the right and TTextAlign.Trailing aligns text to the left. Center is ok. Vertical alignment works as exspected.

The text ‘Hello Peter Kloß!’ appears as ‘!Hello Peter Kloß’. That is surprising! The ‘!’ comes first, then the rest of the text. Perhaps I would understand it when the text comes like ‘!ßolK reteP olleH’. Several tests with some other constellations:
ABC! * -> * !ABC || A.B.C -> A.B.C || A.BC! 0 -> A.BC! 0

[TFillTextFlag.RightToLeft] is the only selectable flag. What sense does it have?

System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Objects, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs;


TForm1 = class(TForm)

pbox: TPaintBox;
procedure FormCreate(Sender: TObject);
procedure pboxPaint(Sender: TObject; Canvas: TCanvas);

procedure TForm1.pboxPaint(Sender: TObject; Canvas: TCanvas);
Canvas.Fill.Color := TAlphaColors.Red;
mRect := TRectF.Create(form1.ClientRect);
Canvas.FillText(mRect, ‘Hello Peter Kloß!’, false, 0.5,
[TFillTextFlag.RightToLeft], TTextAlign.Center, TTextAlign.Leading);

Delphi Community Edition 10.3.3
Windows 10

Comments are closed.