[PyQt] Antialiasing on windows 7 platform

Sylvain Corlay sylvain.corlay at gmail.com
Thu Apr 9 22:16:55 BST 2015


Thank you for your reply. Sadly `-directwrite` does not seem to be standard
way of compiling qt on windows,
and I can't expect it to be the case for people using my code.
Thanks again,
Sylvain


On Wed, Apr 8, 2015 at 10:44 PM, Kovid Goyal <kovid at kovidgoyal.net> wrote:

> On windows, Qt uses GDI for drawing text. Which means that it cannot
> change various things about text rendering, such as hinting (and
> presumably antialiasing), as they are under the control of GDI. You can
> compile Qt 5.4.x to use the freetype font engine on windows as well, in
> which case text rendering should be identical to linux.
>
> See the note for QFont::HintingPreference for details. While that is
> about font hinting, not antialiasing, I believe similar restrictions
> apply for anti-aliasing.
>
> Kovid.
>
> On Wed, Apr 08, 2015 at 12:41:35PM -0400, Sylvain Corlay wrote:
> > Hello,
> >
> > I am having trouble obtaining anti-aliasing in Windows 7 when rendering
> text
> >
> > Both
> >     `painter.setRenderHint(QPainter.Antialiasing)`
> > and
> >     `font.setStyleStrategy(QFont.PreferAntialias)` are ineffective.
> >
> > However, anti-aliasing works when setting up ClearType and smooth edges
> > system-wise
> >
> >     - Control Panel >
> >          Appearance and Personalization >
> >              Adjust ClearType text >
> >                  enable "Turn on CrearType".
> >     - Start Menu >
> >           Adjust the appearance and performance of Windows" or from
> > Computer >
> >               System Properties >
> >                   Windows Experience Index (link) >
> >                       [shield] Adjust visual effects (left sidebar) >
> >                           enable "Smooth edges of screen fonts"
> >
> > Is there a way to forcibly enable anti-aliasing when drawing text, even
> > when those settings are unset? It works perfectly on Linux.
> >
> > Thanks,
> > Sylvain
>
> > _______________________________________________
> > PyQt mailing list    PyQt at riverbankcomputing.com
> > http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>
> --
> _____________________________________
>
> Dr. Kovid Goyal
> http://www.kovidgoyal.net
> http://calibre-ebook.com
> _____________________________________
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150409/11a08115/attachment-0001.html>


More information about the PyQt mailing list