PDA

View Full Version : broken font in qt windows



PstdEr
26th September 2013, 14:42
Hi,
I am facing a strange problem of font display in Qt application windows.

I have installed Qt 4.8.0 in Ubuntu 11.10. when the run the examples given the font of windows is not clear and it is kind of broken.
please see the attached image.

please let me know how to solve the problem.



thanks.

ChrisW67
26th September 2013, 21:40
The example you have does not specify particular font: it just uses the default for the style/platform. Your system is providing a poor substitute for the font requested. This should more-or-less affect all the Qt examples. Install the font being used, probably a basic Truetype sans serif font, or substitute a font with Unicode support.

PstdEr
27th September 2013, 06:13
I have executed other examples also, in all the cases the font is not clear, even the application created by me also does not display proper font.

How can i make Qt takes other fonts?
and if system does not have all fonts or need to change the default font for Qt how to do install it?

i have tried installing below
sudo apt-get install msttcorefonts
gnome-panel and gnome-tweak-tool

but did not help.

ChrisW67
27th September 2013, 08:21
The default font used by Qt on Linux appears to be whatever fontconfig matches for "sans serif".
What does:


$ fc-match 'sans serif'

list on your machine? It's a "DejaVu Sans" on my machine but might be different in your case.

You can see the the default font setting in:


$ qtconfig

however your mileage may vary if your change the font. Some styles do not seem to take note of the setting.

PstdEr
27th September 2013, 09:16
It list the same as yours "DejaVu Sans" for me.
I have tried to modify using qtconfig, but did not help , the effect is same.

I have gone through below links actually

https://bbs.archlinux.org/viewtopic.php?id=166034
https://bbs.archlinux.org/viewtopic.php?id=69336
https://bbs.archlinux.org/viewtopic.php?id=67031

they are saying it has something to do with sub-pixel rendering , but they dint mention where to make changes and how.
do you have any idea?

udita_s
4th May 2016, 13:49
I am facing the same issue.
I am using Qt 4.8.7 in Ubuntu 14.04. I have tried gnome-tweak-tool but nothing seems to be reflected in qt application. Fonts are still broken.