Delphi Android Text render bug?

565 views Asked by At

So I'm working with Delphi XE-8 on Android, using a thread for work in the background. And I have a timer updating a label for the clock from the mainthread (maybe there is a more efficient way to do this).

Now when I start my app on Android, randomly the characters for the clock are being shrunk in size or placed above or below where the character should be. This happens for the same characters during the lifetime of the App, when I close and restart the App it could be different characters. Often a number has the size of an exponant, sometimes the character is missing at all. And another time the bug doesn't appear at all... It happens about 1 out of 4-5 times.

With the picture (below) the '5' is being placed halfway up in the label, the 2 is invisible (maybe entirely above or under the visible label).

enter image description here

Code for the clock looks like this:

procedure TPage0Form.ClockTimerTimer(Sender: TObject);
begin
  ClockTimer.Interval := 1000;
  Page0Form.lb_Clock.Text:= ( TimeToStr(Time));
end;

So I have tried multiple things. 1. Place the clock in a thread, update to UI using sync calls. 2. Use Bitmaps instead of a label (same issue). 3. Play around with the label's settings, labelsize, textsize, fonts, textAlignment, margins, padding etc. But all to no avail.

I am using multiple Android devices with the required (and some of them not) processors, and the bug appears on all of them.

Is there a logical explanation (am I doing something fundamentally wrong) and how to solve this problem?

Thank you for your time and effort.

Edit: This also happens with XE6 and XE7... Edit2: I also tried using:

FMX.Types.GlobalUseGDIPlusClearType
FMX.Types.GlobalUseDirect2D 
FMX.Types.GlobalUseGPUCanvas

None improved the situation.

0

There are 0 answers