Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-12-04 02:32:11

Wallboy
Member
Registered: 2019-12-02
Posts: 3

fontconfig and xresources/xft precedence

Hello, I'm messing around with customizing fonts and their settings to get something I like. I have created the ~/.config/fontconfig/fonts.conf file and can get the system to respect it's settings MOST of the time. However I'm having trouble with applying settings to specific fonts. For example I have the Microsoft TTF fonts installed and I prefer the Arial font to not be anti aliased, so I have the following inside my fonts.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>

  <match target="pattern">
    <test name="family" qual="any">
        <string>Arial</string>
    </test>
    <edit name="hinting" mode="assign">
        <bool>true</bool>
    </edit>
    <edit name="autohint" mode="assign">
        <bool>false</bool>
    </edit>
    <edit name="antialias" mode="assign">
        <bool>false</bool>
    </edit>
  </match>

</fontconfig>

However, this has no effect on the Arial font. Using <match target="font">... to apply settings to global fonts "mostly" works.

I'm wondering how XFCE uses precedence over the settings you have set in the Appearance dialog, vs the fonts.conf file. I'm guessing the dialog sets through xft? I googled this and seen that you can use a ~/.Xresources file to also apply global font settings.

Another oddity is that if I disable Anti-Aliasing in the Appearance dialog, but have it enabled through fonts.conf, the Window titles get Anti-aliased, however all other fonts are aliased.

It's like fonts.conf and the Appearance dialog settings are fighting over which settings are being applied correctly.

Is there a way I get somehow disable this contention and always have the system respect only fonts.conf?

I'm on Xubuntu btw. Hopefully someone can shine some light onto what's going on.

Appreciate any help,

Thanks

Last edited by Wallboy (2019-12-04 02:32:30)

Offline

#2 2019-12-26 09:43:22

apurkrt
Member
From: Czechia, Europe
Registered: 2014-08-31
Posts: 48

Re: fontconfig and xresources/xft precedence

Hi, I have the following remark.

Initially (with nothing in ~/.config/xfce4) the "Enable anti-aliasing" checkbox in Settings/Appearance/Fonts is neither checked nor unchecked - there is a minus sign (or is it dash?) on the checkbox. Yet the anti-aliasing works. Guess the minus means "respect system settings"? (as anti-aliasing is enabled by default in fontconfig).

After explicitly checking "Enable anti-aliasing" and setting hinting to "Full" and "Sub-pixel order" to "RGB", it seems the settings in Settings/Appearance/Fonts and the settings in /etc/fonts/conf.d are battling each other or how to say it. There is strange flickering of the tab titles in firefox on mouseover.

Upon reading "Autohinter is not compatible with sub-pixel rendering, do not use the two together!" at https://wiki.gentoo.org/wiki/Fontconfig, I disabled 10-autohint.conf (eselect fontconfig disable 10-autohint.conf on gentoo). This fixed the issue in firefox.

Hope this helps.

Last edited by apurkrt (2019-12-26 11:28:07)

Offline

#3 2019-12-26 13:11:06

apurkrt
Member
From: Czechia, Europe
Registered: 2014-08-31
Posts: 48

Re: fontconfig and xresources/xft precedence

Another observation: I now wiped the ~/.config/xfce4 (i.e. went to default config) and I left the "Enable anti-aliasing" in the initial state (i.e. with the minus). The intention was to achieve a good font rendering solely with fontconfig changes, so I also did the following (compared to the default state):
- disabled 10-autohint.conf
- enabled 10-hinting-full.conf
- enabled 10-sub-pixel-rgb.conf
- enabled 11-lcdfilter-default.conf

(I used "eselect fontconfig" for this - a gentoo command, which creates or removes the links in /etc/fonts/conf.d)

After that, the fonts were quite fine (antialiased, crisp) in firefox, thunar, window titles (i.e. xfwm4), mousepad.
But there were also some gtk3 apps with blurred fonts: hexchat, geany.

That was really strange. So I started X with openbox, and it seems the blurring has something to do with Xfce. Since under openbox, hexchat and geany both works fine (and all the other apps too). In Xfce, hexchat and geany are blurred.

Offline

#4 2019-12-26 14:38:44

apurkrt
Member
From: Czechia, Europe
Registered: 2014-08-31
Posts: 48

Re: fontconfig and xresources/xft precedence

After some more fiddling, this is the configuration that works for me now:

1) fontconfig: /etc/fonts/conf.d:
- disabled 10-autohint.conf (i.e. removed the link from /etc/fonts/conf.d)
- all the other files left untouched from default (i.e. 10-hinting-full, 10-sub-pixel-rgb, 11-lcdfilter-default all left disabled)
2) Xfce: Settings/Appearance/Fonts:
- "Enable anti-aliasing" checkbox left in the initial state with minus (checking it works too)
- "Hinting" set to Full
- "Sub-pixel-order" untouched (left at "None")

With this, the fonts look good everywhere, including hexchat and geany.

Conclusion: I do not know what the minus sign at the "Enable anti-aliasing" checkbox means, since even if there was "minus", the Hinting settings somehow was in effect.

All in all, I found a working combination just by random trying.

Offline

Board footer

Powered by FluxBB