Cleartype font / text rendering in Firemonkey
Asked Answered
S

0

6

Here is a sample VCL application containing just a TEdit control.

VCL

If you compile a similar Firemonkey (FMX) application you will notice this:

FMX

(The small L letter is jumping around like crazy)

On my research i found this G+ post which results in:

enter image description here

As you can see the result is better.

The jumping is gone. However the TCircle isn't rendered very nicely.

After some more research i found out that using initialization GlobalUseDX := False; has a better output:

enter image description here

Occasionally there is still some "letter hopping" going on but it's a better result. However it seems there is some background color behind the small L's (yellowish).

Does anyone know a better way to achieve ClearType-like font rendering using the latest Firemonkey?

Span answered 1/6, 2015 at 17:5 Comment(4)
It's actually a very complicated issue. Have you ever written a text renderer, working on three or four different graphics APIs, accounting for spacing with antialiased variable-width fonts? There's a reason many other similar renderers - including some by Microsoft - have similar problems. I saw a bug on OSX quite like this just the other day (with the letter 'r', not 'l'.) IMO, unless your users are commonly going to enter in a hundred Ls in a row, it is unlikely to be a very important issue.Codel
@Codel H - FireMonkey is the target platform.Crossland
@DavidHeffernan Because then you end up doing things like rendering with GDI, grabbing the bitmap, converting the format, and loading it back into GPU memory. Plus other problems. Or, in short, the same reason Direct2D/DirectWrite doesn't do this and has its own layer (and don't forget many people complain about its text rendering too.)Codel
I can see that criticism is off limits here. My comment has gone. Never mind.Hulse

© 2022 - 2024 — McMap. All rights reserved.