<div dir="ltr">Thank you for your reply. Sadly `-directwrite` does not seem to be standard way of compiling qt on windows, <div>and I can't expect it to be the case for people using my code. </div><div>Thanks again,</div><div>Sylvain</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 10:44 PM, Kovid Goyal <span dir="ltr"><<a href="mailto:kovid@kovidgoyal.net" target="_blank">kovid@kovidgoyal.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On windows, Qt uses GDI for drawing text. Which means that it cannot<br>
change various things about text rendering, such as hinting (and<br>
presumably antialiasing), as they are under the control of GDI. You can<br>
compile Qt 5.4.x to use the freetype font engine on windows as well, in<br>
which case text rendering should be identical to linux.<br>
<br>
See the note for QFont::HintingPreference for details. While that is<br>
about font hinting, not antialiasing, I believe similar restrictions<br>
apply for anti-aliasing.<br>
<br>
Kovid.<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Apr 08, 2015 at 12:41:35PM -0400, Sylvain Corlay wrote:<br>
> Hello,<br>
><br>
> I am having trouble obtaining anti-aliasing in Windows 7 when rendering text<br>
><br>
> Both<br>
>     `painter.setRenderHint(QPainter.Antialiasing)`<br>
> and<br>
>     `font.setStyleStrategy(QFont.PreferAntialias)` are ineffective.<br>
><br>
> However, anti-aliasing works when setting up ClearType and smooth edges<br>
> system-wise<br>
><br>
>     - Control Panel ><br>
>          Appearance and Personalization ><br>
>              Adjust ClearType text ><br>
>                  enable "Turn on CrearType".<br>
>     - Start Menu ><br>
>           Adjust the appearance and performance of Windows" or from<br>
> Computer ><br>
>               System Properties ><br>
>                   Windows Experience Index (link) ><br>
>                       [shield] Adjust visual effects (left sidebar) ><br>
>                           enable "Smooth edges of screen fonts"<br>
><br>
> Is there a way to forcibly enable anti-aliasing when drawing text, even<br>
> when those settings are unset? It works perfectly on Linux.<br>
><br>
> Thanks,<br>
> Sylvain<br>
<br>
</div></div><span class="im HOEnZb">> _______________________________________________<br>
> PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
> <a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
<br>
<br>
</span><span class="HOEnZb"><font color="#888888">--<br>
_____________________________________<br>
<br>
Dr. Kovid Goyal<br>
<a href="http://www.kovidgoyal.net" target="_blank">http://www.kovidgoyal.net</a><br>
<a href="http://calibre-ebook.com" target="_blank">http://calibre-ebook.com</a><br>
_____________________________________<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></div></div></blockquote></div><br></div>