FireMonkey DirectX canvas ClearType text


Why Firemonkey doesn’t use ClearType when rendering text on D2D canvas?
I found this question Cleartype font / text rendering in Firemonkey and after some more research I found after pathing FMX.Canvas.D2D TCanvasD2D.CreateResources

If GlobalUseGDIPlusClearType
then FTarget.SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE)
else FTarget.SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE);

it actually draws ClearType text in test application (some TLabels on the form).

More tests shows that after adding a TMemo (and some other controls) to the form ClearType suddenly disappears…

Having that, just to test I added the following line to TTextLayoutD2D.DoDrawLayout


Now only TLabel is shown properly (with ClearType), but TEdit and TMemo does not draw text at all…

Comments are closed.