How to draw clear text using Skia for 4K screens in Delphi?

122 Views Asked by At

What is the best way to generate clear text using Skia4Delphi especially on a 4K or 8K monitor? I'm currently using this code, but the text isn't too bad, but could be much clearer on a 4K and 8K monitor.

This is my code:

var 
  LBlob: ISkTextBlob;
  LPaint: ISkPaint;
  ABounds: TRectF;
  tx, ty: Single;
begin
  LPaint := TSkPaint.Create;
  LPaint.Color := TAlphaColors.Black;
  LPaint.Style := TSkPaintStyle.Fill;

  id.font.MeasureText(id.value, ABounds, LPaint);

  tx := x + (w/2 - ABounds.Width/2);
  ty := y + (h/2 + ABounds.Height/2);

  LBlob := TSkTextBlob.MakeFromText(id.value, id.font);
  ACanvas.DrawTextBlob(LBlob, tx, ty, LPaint);
end;

id is an object that I have that stores a Skia font object.

My project is in FireMonkey (FMX).

0

There are 0 best solutions below