[Lazarus] TCanvas.TextRect, subpixel antialiasing with Qt4
prof7bit at googlemail.com
Sun Mar 25 15:24:44 CEST 2012
I'm currently experimenting with the IDE compiled for the Qt widgetset
and also with an application that will use the TIpHtmlPanel for
displaying some text and there is a strange discrepancy between the
text rendering on GTK2 and on Qt4.
It becomes obvious if you compare the two hint windows in the two
screenshots below, one is the IDE compiled with Qt and the other with
GTK2. The hint window is using the turbopower_ipro html component, the
same that I want to use in my own application. It is calling
TCanvas.TextRect() to render the text to the canvas and this has
different results depending on the currently used widgetset.
The strange thing about this is that as you can see from the
screenshots the entire IDE, the entire widgetset is using the same
font rendering settings, buttons, menus, labels etc are respecting my
font settings: hintfull and subpixel RGB anti-aliasing. Everything is
looking beautiful, except the text that is rendered via TextRect() in
the hint window. In the second screenshot look at the "/", "A", "x",
"()" characters in the hint window, they are quite ugly compared to
the GTK example and this looks exactly like subpixel-antialiasing is
Is this a bug in TCanvas or is this the wrong usage in the IpHtml
component? Can anybody reproduce this effect?
Note that I am not using KDE, I am using Xubuntu and have used
qtconfig-qt4 to set the Qt4 theme and I have a ~/.fonts.conf file that
has the same hinting- and antialiasing-settings defined (just in case
some application does not understand the GTK settings). Maybe there
are even more different places where I can set these settings?
More information about the Lazarus