[Qt-qml] Font rendering quality in QDeclarative
michael.brasser at nokia.com
michael.brasser at nokia.com
Wed Sep 15 05:34:19 CEST 2010
On 15/09/2010, at 8:58 AM, ext Alex wrote:
> Hi all,
>
> For a while now, I've had the nagging feeling that text doesn't look
> quite right in my application. As a sanity check, I ran the
> availableFonts.qml sample application (from declarative/text/fonts)
> using QML Viewer, and it looked fine. I then ran the same application
> using QDeclarative and the results were much more similar to my
> application.
>
> Here is a side-by-side comparison of how availableFonts.qml looks when
> run using QML Viewer vs QDeclarativeEngine.
>
> http://members.shaw.ca/amonjushko/font_render_quality.png
>
> You'll notice that the right hand side is significantly less smooth.
> The difference becomes even more severe with black text on a white
> background.
>
> My C++ code looks like this:
>
> QDeclarativeView *qmlView = new QDeclarativeView;
> QDeclarativeEngine *engine = qmlView->engine();
> qmlView->setSource(QUrl::fromLocalFile("/Developer/Examples/Qt/declarative/text/fonts/availableFonts.qml"));
> qmlView->show();
>
> I am using 4.7rc1 on Mac OSX 10.6.3.
>
> Any ideas?
The difference in the two is that QML Viewer uses a QGLWidget as the viewport of its QDeclarativeView, and uses the "raster" graphics system.
The basic issue has to do with with the fact that QML draws all of its text to pixmaps. We've tried several approaches to fixing this, but at the moment using raster is the best alternative.
Regards,
Michael
More information about the Qt-qml
mailing list