Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icons are looking bad on Windows 7 #4

Closed
goanpeca opened this issue Mar 11, 2015 · 19 comments
Closed

Icons are looking bad on Windows 7 #4

goanpeca opened this issue Mar 11, 2015 · 19 comments
Labels

Comments

@goanpeca
Copy link
Member

image

@ccordoba12
Copy link
Member

From the title and text of your screenshot, it seems your Windows version is not using anti-aliasing.

@goanpeca
Copy link
Member Author

@SylvainCorlay
Copy link
Member

We should be able to force anti-aliasing with painter.setRenderHint(QPainter.Antialiasing) in the paint method. Will fix this this week-end.

@goanpeca
Copy link
Member Author

I tried that. It made no difference. But let me know

@goanpeca
Copy link
Member Author

Ok so it seems that when TrueType is enabled in windows, qtawesome results in aliased icons. This is unexpected, because apparently qt should use trueype if enabled...

@SylvainCorlay
Copy link
Member

I also tried using font.setStyleStrategy(QFont.PreferAntialias) but no luck so far.

Besides, forcing the size to be multiple of 14, which is the pixel perfect size of font awesome and the spyder makes anti-aliasing less necessary.

@goanpeca
Copy link
Member Author

goanpeca commented Apr 8, 2015

@SylvainCorlay, yep I had tried that one as well, but it is a weird "bug" from qt I think. Still even at pixel perfect if no antialias is in place icons will look pixelated like an 80's game :-)

@SylvainCorlay
Copy link
Member

Actually at pixel perfect size, it is difficult to see the difference .The problem remains for brand icons and such, (like the Python logo) which are not meant to be pixel perfect.

@SylvainCorlay
Copy link
Member

@ccordoba12 I had some questions on gitter regarding your qt build on windows.

@ccordoba12
Copy link
Member

We don't build Qt on Windows. We just use the binaries supplied by Riverbank (the company behind PyQt)

@SylvainCorlay
Copy link
Member

It seems that the binaries are not configured to use directwrite on Windows 7.

See: http://pyqt.sourceforge.net/Docs/PyQt4/qfont.html

Please be aware that altering the hinting preference on Windows is available through the DirectWrite font engine. This is available on Windows Vista after installing the platform update, and on Windows 7. In order to use this extension, configure Qt using -directwrite. The target application will then depend on the availability of DirectWrite on the target system.

@ccordoba12
Copy link
Member

Then what do we (i.e. Continuum) should do about it? Should we ask Riverbank for that option?

@SylvainCorlay
Copy link
Member

It seems that directwrite was intended to replace GDI and should probably be the preferred way of rendering fonts on screen. Although I should make some more experiments with my own build to be able to make an educated recommendation. The problem is that I don't use windows too often and my development machine is a Linux one.

@kovidgoyal replied to my email on the PyQt mailing list with some pointers at where to look

A few observations though:

  • even with ClearType and Smooth edges enabled (which is the default on all the machines I used, the fonts don't look quite as sharp as on linux, where is it nearly perfect.)
  • At pixel perfect size of the font, the problem is much less visible. There are some options in how text is rendered to try using certain preferred sizes.

@ccordoba12
Copy link
Member

Ok, let me know what you find to see what we can do about it in our side :-)

@SylvainCorlay
Copy link
Member

Btw, there is also the FreeType font engine, which is used on linux, and can (apparently) be used for a windows build.
If one gets a build of qt where directwrite (or freetype) is enabled, it will support setting up hinting with QFont.setHintingPreference, and we will be able to choose what we prefer among PreferDefaultHinting PreferNoHinting PreferVerticalHinting PreferFullHinting.

PreferDefaultHinting PreferNoHinting PreferVerticalHinting PreferFullHinting
Win Vista (w/o Platform Update) and earlier Full hinting Full hinting Full hinting Full hinting
Win 7 and Win Vista (w/Platform Update) and DirectWrite enabled in Qt Full hinting Vertical hinting Vertical hinting Full hinting
FreeType Operating System setting No hinting Vertical hinting (light) Full hinting
Cocoa on Mac OS X No hinting No hinting No hinting No hinting

@SylvainCorlay
Copy link
Member

@ccordoba12 you guys now ship freetype with Anaconda?

@ccordoba12
Copy link
Member

Yes, I think we have it available on all platforms. I'm totally sure on Linux and Mac, but not so sure on Windows :-)

@goanpeca goanpeca modified the milestone: 0.4 Oct 13, 2016
@ccordoba12 ccordoba12 modified the milestones: 0.4, v0.5 Dec 30, 2016
@ccordoba12 ccordoba12 removed this from the v0.5 milestone Sep 12, 2018
@goanpeca
Copy link
Member Author

Should we close this @ccordoba12 ?

@ccordoba12
Copy link
Member

Sure, let's do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants