PDA

View Full Version : Why fonts in Qt are appearing blurry or pixelated?



Abhay_Salvi
11th May 2020, 12:19
All my fonts are appearing pixelated, so I used AntiAliasing but it isn't helping. As you can see in the image itself:

13437

This is the code I am using:



butt1 = QtWidgets.QLabel("""Scrappr""")
font = QtGui.QFont()
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
font.setPixelSize(22)
font.setFamily('Segoe UI Bold')
butt1.setFont(QtGui.QFont(font))


Edit 1: I also tried different combinations of ClearType text but It didn't work out. I think because for me, by default all the text appears good on windows and chrome but with Qt, it becomes pixelated. So it's probably not a windows problem...

ChrisW67
14th May 2020, 10:03
All my fonts are appearing pixelated, so I used AntiAliasing but it isn't helping. As you can see in the image itself:

So it's probably not a windows problem...

It is is happening to all the text in your application then it is probably a Windows feature whereby it takes non-DPI aware applications, renders them off-screen, and scales them on to the display. Can accentuate jaggy edges and makes all text look fuzzy. You seem to be using PyQt, so dealing with this might be tricky. What Qt version?

Abhay_Salvi
16th May 2020, 16:01
I have both PyQt and PySide2 version (5.14.2)...