Joel JO wrote:
> Hi,
>
> is it a known bug that QPainter does not do antialiasing for smaller
> fonts on Windows ?
> In the code sample below, if size<=16 it will not be antialiased and if
> size>=18 it will be antialiased.
> It worked fine with 4.4.3
>
> import com.trolltech.qt.gui.QApplication;
> import com.trolltech.qt.gui.QColor;
> import com.trolltech.qt.gui.QFont;
> import com.trolltech.qt.gui.QImage;
> import com.trolltech.qt.gui.QPainter;
>
> public class test {
>
> public static void main(String[] args) {
> QApplication.initialize(args);
> QImage img = new QImage(400, 80, QImage.Format.Format_ARGB32);
When using normal antialiasing, non-cleartype, windows decides to not
antialias the point sizes around 8-16 or thereabout. So for this
particular font 18 is antialiased while 16 is not. Its windows that does
this, not us. We just use the glyphs we get from the system.
If you have cleartype enabled you would still get hit by this issue
because of the change we did in text drawing to increase performance.
From the Qt 4.5.0 changelog:
<quote>
* Cleartype rendering was previously supported onto QImages with
an ARGB32 channel. For performance reasons, cleartype is now
only supported on opaque images using the RGB32 or
ARGB32_Premultipled format. Widget and pixmap rendering is
unchanged
</endquote>
For drawing to an image you should use the formats ARGB32_Premultiplied
for alpha drawing and RGB32 for opaque drawing. Format_ARGB32 should
only be used for direct pixel manipulation.
best regards,
Gunnar
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest