FS#59957 - [fontconfig] updates always mess up my font configuration

Attached to Project: Arch Linux
Opened by stefan (stefan1) - Thursday, 06 September 2018, 09:10 GMT
Last edited by Doug Newgard (Scimmia) - Thursday, 06 September 2018, 14:05 GMT
Task Type General Gripe
Category Packages: Extra
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: Fontconfig updates always mess up my font configuration. It's an issue that's been haunting me for years now, since I have a pretty nice and working font setup, with sharp (not blurry) fonts. It relies on deleting most of the files from `/etc/fonts/conf.d`, and just adding very few of my own.

Unfortunately, updating typically confronts me with a lot of warnings from `pacman`, along the liens of

...
warning: could not get file information for etc/fonts/conf.d/40-nonlatin.conf
warning: could not get file information for etc/fonts/conf.d/45-generic.conf
warning: could not get file information for etc/fonts/conf.d/45-latin.conf
warning: could not get file information for etc/fonts/conf.d/51-local.conf
warning: could not get file information for etc/fonts/conf.d/60-generic.conf
...

After that, fonts in most programs (from `xterm` to `firefox`) are blurry.

I wonder whether packaging could be done without providing links in `/etc/fonts/conf.d`? The default seems to be usable, and the files are available in `/etc/fonts/conf.avail` anyways.
This task depends upon

Closed by  Doug Newgard (Scimmia)
Thursday, 06 September 2018, 14:05 GMT
Reason for closing:  Not a bug
Additional comments about closing:  Config issue
Comment by Paul Bredbury (brebs) - Thursday, 06 September 2018, 10:39 GMT
Can't you simply put your custom config in e.g. /etc/fonts/conf.d/99-custom.conf ?

Using a high number, so it overrides the other rules.
Comment by stefan (stefan1) - Thursday, 06 September 2018, 11:19 GMT
I think it's too messy to explicitly undo all the changes pulled into the config by links in `/etc/fonts/conf.d`. I've tried this a long time ago (sorry, don't recall more precisely) but this quickly got out of control: I was in a constant struggle to figure out which update in the config messed up font rendering again, and then counteract (after sort of understanding what happened, or not understanding). Now I really just delete most of the links in `/etc/fonts/conf.d`, and pull in what I really needed. Much less pain. I'd like this to be stable across updates.
Comment by Paul Bredbury (brebs) - Thursday, 06 September 2018, 11:35 GMT
So, fontconfig rules confuse you, yet you wish to be in complete control of fontconfig rules? I have little confidence.

Show your custom fontconfig ruleset.

I expect it's better to work alongside the default fontconfig rules (perhaps those default rules can be tweaked).

Sounds like you should use e.g. https://aur.archlinux.org/packages/fontconfig-infinality-ultimate/ , or your own custom fontconfig package.
Comment by stefan (stefan1) - Thursday, 06 September 2018, 11:55 GMT
> So, fontconfig rules confuse you, yet you wish to be in complete control of fontconfig rules?

No, actually not. I just don't want the upgrade process to mess up every time. Any means that preserves my simple custimization across updates would be appreciated. I hope it's not necessary to master fontconfig configuration in its entirety to this end.

> Show your custom fontconfig ruleset.

Here you go:

/etc/fonts/conf.d$ l
total 21k
lrwxrwxrwx 1 root users 39 Sep 3 11:17 49-sansserif.conf -> /etc/fonts/conf.avail/49-sansserif.conf
lrwxrwxrwx 1 root users 34 Sep 3 11:17 50-user.conf -> /etc/fonts/conf.avail/50-user.conf
lrwxrwxrwx 1 root users 33 Sep 3 11:17 57-dejavu-sans.conf -> ../conf.avail/57-dejavu-sans.conf
lrwxrwxrwx 1 root users 38 Sep 3 11:17 57-dejavu-sans-mono.conf -> ../conf.avail/57-dejavu-sans-mono.conf
lrwxrwxrwx 1 root users 34 Sep 3 11:17 57-dejavu-serif.conf -> ../conf.avail/57-dejavu-serif.conf

This is the complete listing. Notice that quite some links have been deleted. Also, there's this:

~/.config/fontconfig$ cat fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--

For this to work, `~/.config/fontconfig/fonts.conf` must be found by
fontconfig. Verify this using

$ strace fc-match sans-serif: 2>&1 | grep "${HOME}.*/fonts\.conf"

-->
<fontconfig>
<match target="pattern">
<test qual="any" name="family"><string>sans-serif</string></test>
<edit name="family" mode="assign" binding="same"><string>DejaVu Sans</string></edit>
</match>
</fontconfig>

Loading...