[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] Antialiasing on windows 7 platform
From:       Kovid Goyal <kovid () kovidgoyal ! net>
Date:       2015-04-09 2:56:06
Message-ID: 20150409024406.GB888 () qedette
[Download RAW message or body]

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@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt


-- 
_____________________________________

Dr. Kovid Goyal 
http://www.kovidgoyal.net
http://calibre-ebook.com
_____________________________________
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic