You are not logged in.

#1 2017-06-17 02:29:01

guihkx
Member
Registered: 2013-03-22
Posts: 34

[SOLVED] Bold Cantarell font only in QT programs

I'm having this really weird issue with QT4 / QT5 programs. I use XFCE and my default font is Cantarell Regular, 10. The thing is, only in QT programs Cantarell is rendered as bold. Here's how it looks in qBittorent:

https://i.imgur.com/Gi13URE.png

Now, qBittorrent using a different font (Candara):

https://i.imgur.com/dpUfaag.png

My /etc/fonts/local.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
    <edit name="embeddedbitmap" mode="assign">
        <bool>false</bool>
    </edit>
</match>
</fontconfig>

Cantarell version:

cantarell-fonts 1:0.0.25-3

Does anyone know why this is happening? Thank you.

Last edited by guihkx (2017-06-17 15:11:09)

Offline

#2 2017-06-17 03:16:48

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: [SOLVED] Bold Cantarell font only in QT programs

What does your ~/.config/fontconfig/fonts.conf look like?  Also, try changing the hinting from full to something lower, that might help.

Offline

#3 2017-06-17 03:32:35

guihkx
Member
Registered: 2013-03-22
Posts: 34

Re: [SOLVED] Bold Cantarell font only in QT programs

I don't have a ~/.config/fontconfig/fonts.conf...

I've tried disabling anti-aliasing and hinting but it didn't have any effect, which is weird. By the way, I use the following environment variables so that QT5 programs can "mimic" my GTK+ theme:

export QT_QPA_PLATFORMTHEME='gtk2'
export QT_STYLE_OVERRIDE='gtk2'
export DESKTOP_SESSION='gnome'

I also have installed qt5-styleplugins and qt5ct, which are required for those environment variables to work properly, according to the wiki. I've tried uninstalling them but it didn't have any effect font-wise.

Isn't it weird that is happening only with Cantarell? It used to look just fine by the way. I don't remember the exact day it started looking like this, but maybe was this update:

[2017-05-22 00:14] [ALPM] upgraded qt5-declarative (5.8.0-1 -> 5.8.0-2)
[2017-05-25 18:26] [ALPM] upgraded qt5-base (5.8.0-11 -> 5.8.0-12)
[2017-05-25 18:26] [ALPM] upgraded qca-qt5 (2.1.3-3 -> 2.1.3-4)
[2017-06-01 04:54] [ALPM] upgraded phonon-qt5 (4.9.1-2 -> 4.9.1-4)
[2017-06-01 04:54] [ALPM] upgraded qt5ct (0.32-1 -> 0.33-1)
[2017-06-02 05:12] [ALPM] upgraded poppler-qt5 (0.54.0-1 -> 0.55.0-1)
[2017-06-06 03:55] [ALPM] upgraded poppler-qt5 (0.55.0-1 -> 0.55.0-3)
[2017-06-09 02:19] [ALPM] upgraded qt5-base (5.8.0-12 -> 5.9.0-2)
[2017-06-09 02:19] [ALPM] upgraded qt5-xmlpatterns (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-declarative (5.8.0-2 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-location (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-sensors (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-webchannel (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-webkit (5.8.0-3 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-quickcontrols (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-x11extras (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-multimedia (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-speech (5.8.0-2 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-svg (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5-script (5.8.0-1 -> 5.9.0-1)
[2017-06-09 02:19] [ALPM] upgraded qt5ct (0.33-1 -> 0.33-2)

I don't know if I should downgrade all of them to test it...

EDIT: I've downgraded all qt5* packages to 5.8.0 just to confirm it... This is how it is supposed to look:

https://i.imgur.com/VUZuG4N.png

Now I guess I have to find out exactly which qt5* package is the culprit...

Last edited by guihkx (2017-06-17 03:54:49)

Offline

#4 2017-06-17 06:24:06

seth
Member
Registered: 2012-09-03
Posts: 51,056

Re: [SOLVED] Bold Cantarell font only in QT programs

"By the way, I use the following environment variables"

And if you don't?
This looks more like a hinting issue than a weight issue and it looks like hintfull is ignored in the "bad" version, what *could* be some "compatibility" adjustment.

Offline

#5 2017-06-17 15:10:51

guihkx
Member
Registered: 2013-03-22
Posts: 34

Re: [SOLVED] Bold Cantarell font only in QT programs

seth wrote:

"By the way, I use the following environment variables"

And if you don't?
This looks more like a hinting issue than a weight issue and it looks like hintfull is ignored in the "bad" version, what *could* be some "compatibility" adjustment.

You guys were right, it was indeed a hinting issue! I fixed it by enabling "autohint" for Cantarell in ~/.config/fontconfig/fonts.conf:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <match target="font">
        <edit name="antialias" mode="assign">
            <bool>true</bool>
        </edit>
        <edit name="hinting" mode="assign">
            <bool>true</bool>
        </edit>
        <edit name="hintstyle" mode="assign">
            <const>hintfull</const>
        </edit>
        <edit name="rgba" mode="assign">
            <const>rgb</const>
        </edit>
        <edit name="lcdfilter" mode="assign">
            <const>lcddefault</const>
        </edit>
        <edit name="dpi" mode="assign">
            <double>96</double>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>Cantarell</string>
        </test>
        <edit name="autohint" mode="assign">
            <bool>true</bool>
        </edit>
    </match>
</fontconfig>

Thank you!

Last edited by guihkx (2017-06-17 18:45:48)

Offline

Board footer

Powered by FluxBB