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

List:       pykde
Subject:    Re: [PyQt] Antialiasing on windows 7 platform
From:       Sylvain Corlay <sylvain.corlay () gmail ! com>
Date:       2015-04-09 21:16:55
Message-ID: CAK=Phk6kO14Rb67=6DmZMsxs6HoN7wd6siTdaaY5M7Mfe1-wsw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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@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@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
>

[Attachment #5 (text/html)]

<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&#39;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">&lt;<a href="mailto:kovid@kovidgoyal.net" \
target="_blank">kovid@kovidgoyal.net</a>&gt;</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>
&gt; Hello,<br>
&gt;<br>
&gt; I am having trouble obtaining anti-aliasing in Windows 7 when rendering text<br>
&gt;<br>
&gt; Both<br>
&gt;        `painter.setRenderHint(QPainter.Antialiasing)`<br>
&gt; and<br>
&gt;        `font.setStyleStrategy(QFont.PreferAntialias)` are ineffective.<br>
&gt;<br>
&gt; However, anti-aliasing works when setting up ClearType and smooth edges<br>
&gt; system-wise<br>
&gt;<br>
&gt;        - Control Panel &gt;<br>
&gt;               Appearance and Personalization &gt;<br>
&gt;                     Adjust ClearType text &gt;<br>
&gt;                           enable &quot;Turn on CrearType&quot;.<br>
&gt;        - Start Menu &gt;<br>
&gt;                 Adjust the appearance and performance of Windows&quot; or \
from<br> &gt; Computer &gt;<br>
&gt;                       System Properties &gt;<br>
&gt;                             Windows Experience Index (link) &gt;<br>
&gt;                                   [shield] Adjust visual effects (left sidebar) \
&gt;<br> &gt;                                         enable &quot;Smooth edges of \
screen fonts&quot;<br> &gt;<br>
&gt; Is there a way to forcibly enable anti-aliasing when drawing text, even<br>
&gt; when those settings are unset? It works perfectly on Linux.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Sylvain<br>
<br>
</div></div><span class="im HOEnZb">&gt; \
_______________________________________________<br> &gt; PyQt mailing list      <a \
href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br> &gt; <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>



[Attachment #6 (text/plain)]

_______________________________________________
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