fonts in Qt4 look ugly because it uses Nimbus Sans L instead of Deja Vu Sans for Sans-Serif

Reported by Guillaume Martres on 2008-03-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qt4-x11 (Ubuntu)

Bug Description

In /etc/fonts/conf.d/45-latin.conf and /etc/fonts/conf.d/60-latin.conf, "DejaVu Sans" is the second alias for Sans Serif and "Nimbus Sans L" is the next to last alias. Furthermore, Qt3 and GTK apps use "DejaVu Sans" as the Sans Serif font.
But Qt4 seems to completely ignore these settings and use "Nimbus Sans L" as the Sans Serif font, which looks really ugly(at least with my monitor), changing the default font from "Sans Serif" to "DejaVu Sans" in qtconfig-qt4 workaround the problem, the change must also be done in KDE4 Appearance kcm module.
Attached is a screenshot of qtconfig-qt3(left) and qtconfig-qt4(right) for comparison, they both use the default font(Sans Serif).

Guillaume Martres (smarter) wrote :
Jonathan Riddell (jr) wrote :

I've no idea why this would happen

Changed in qt4-x11:
status: New → Confirmed
Che Guevara (che-guevara-3) wrote :

Marking as fix released, since an update has been uploaded to fix this

Changed in qt4-x11:
status: Confirmed → Fix Released
Guillaume Martres (smarter) wrote :

This bug is not really fixed, it has been worked around in KDE4 by forcing DejaVu Sans as default font in kubuntu-default-settings, but the bug is still there for pure Qt4 apps and people who don't use kubuntu-default-settings.

Changed in qt4-x11:
status: Fix Released → Confirmed

For some reason Qt 4, at least its X11 version, substitutes "Sans Serif" with "Helvetica". You can see that in "Font Substitution" panel in "Fonts" tab of Qt 4 configuration tool.

Even if you remove that option from ~/.config/Trolltech.conf, your modification will be ignored, so it seems to be hard-coded.

Hannes Kuhnert (hannes-kuhnert) wrote :

I’m trying KDE 4 these days and I was surprised to see everything in Helvetica (Nimbus Sans). It had adopted the font settings of KDE 3 which demand a sans serif generically, fontconfig resolves “Sans Serif” to “Lucida Sans”, as “fc-match” shows, but Qt 4 (KDE 4) anyway uses Helvetica for generic sans serif.

That hardcoded substitution in Qt 4 is really annoying. I’m really using the flexible fontconfig configuration framework, but Qt 4 breaks it, demanding much higher efforts in configuring applications to my wishes. That is a question of standard compliance. I’m going to contact Qt Software (formerly known as Trolltech).

Guillaume Martres (smarter) wrote :

@Hannes Kuhnert: did you get an answer from them?

luisgarrido (luisgarrido) wrote :

Bug still active as of 16 March 2009.

luisgarrido (luisgarrido) wrote :

A workaround is to remove Nimbus from the system by uninstalling the 'gsfonts' package, but packages like 'gimp' depend on it.

luisgarrido (luisgarrido) wrote :

It seems that this Qt version has hardcoded the generic type "Helvetica" as "Sans Serif". Helvetica is defined at /etc/fonts/conf.d/30-metric-aliases.conf as "Nimbus Sans L"

You can change it there or add to your ~/.fonts.conf the following stanzas:

        <alias binding="same">

Then refresh your font cache with fc-cache, restart your application and you should be watching a nice, crisp, hinted font.

Substitute Arial for the font of your choice. BEWARE: there are some consequences to this that I don't understand well because of font metrics and what not, read this bug for more information:


Changed in qt4-x11 (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments