[Qt-qml] Font rendering quality in QDeclarative

michael.brasser at nokia.com michael.brasser at nokia.com
Thu Sep 16 01:54:33 CEST 2010


On 16/09/2010, at 4:33 AM, ext Alex wrote:

> On Tue, Sep 14, 2010 at 8:34 PM,  <michael.brasser at nokia.com> wrote:
>> On 15/09/2010, at 8:58 AM, ext Alex wrote:
> 
>>> 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.
>> 
> 
> Thanks, Michael.  I was able to get good results by switching to the
> "raster" graphics system.  Setting QGLWidget as the viewport does not
> seem to make any difference... is it supposed to?

No, it shouldn't make any visual difference in this case -- we picked it in conjunction with raster because it seemed to produce the best overall combination on OS X (see for example the bug http://bugreports.qt.nokia.com/browse/QTBUG-10685 which occurs under raster, but not with raster + gl).

Regards,
Michael



More information about the Qt-qml mailing list