[Interest] Text is not being anti-aliased.
Jason H
jhihn at gmx.com
Fri Jan 30 17:56:08 CET 2015
Back in Qt4, (the last time I wrestled with this issue - Win XP) there was a setting in Windows about anti-aliased fonts. Qt respected that setting, unless you explicitly told Qt to override it. I think you're in a similar situation.
> Sent: Friday, January 30, 2015 at 10:56 AM
> From: "william.crocker at analog.com" <william.crocker at analog.com>
> To: "interest at qt-project.org" <interest at qt-project.org>
> Subject: [Interest] Text is not being anti-aliased.
>
> Hello:
>
> I have code to create a PNG file from a QGraphicsScene.
> When I run this on Linux, text is anti-aliased. This is good.
> When I run this on Windows, text is NOT anti-aliased. This is bad.
> I would like the text to be anti-aliased.
>
> Am I doing something wrong?
> Is this a Windows bug?
> Is there a workaround?
>
> Thanks.
>
> Bill
>
> Qt 4.8.6
> Visual Studio 2008
>
> ---------------------------------
> void
> MyScene::exportImagePNG( const QString &fn ) {
> QRectF scene_rect = sceneRect();
> QSize size(qRound(scene_rect.width()),qRound(scene_rect.height()));
> QImage im(size,QImage::Format_RGB32);
> QPainter painter(&im);
> painter.setRenderHint(QPainter::Antialiasing,true);
> painter.setRenderHint(QPainter::TextAntialiasing,true);
> painter.fillRect(im.rect(),Qt::white);
> render(&painter);
> im.save(fn,"PNG");
> }
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
More information about the Interest
mailing list