You are not logged in.
I am running xfce4 and I have antialiasing turned off in Settings -> Appearance -> Fonts because I really prefer pixel-perfect non-antialiased fonts for system menus and other stuff.
However, this turns antialiasing of everywhere. Specifically in Firefox (or Chrome), non-antialiased fonts are ugly. I was wondering if there is a way to enable antialiasing just for specific applications. I have tried some Firefox-specific hacks via about:config, but I couldn't make it work.
Offline
https://www.freedesktop.org/software/fo … -user.html
FONTCONFIG_FILE is used to override the default configuration file.
FONTCONFIG_PATH is used to override the default configuration directory.
Offline
@seth, thanks for your answer! Could you please explain how should I use FONTCONFIG variables to achieve what I want? I don't really understand how the whole thing works between XFCE, fontconfig and the programs.
Offline
You write a fontconfig file with your desired settings (activated aliasing, otherwise a copy of your local config, I guess)
See https://wiki.archlinux.org/index.php/Fo … figuration
Then try to export the path to this config and start firefox from a shell that has the alternative path exported.
Ultimately you probably want to add a wrapper script that exports the fonconfig path and runs firefox with that path (or simply adjust the desktop service to call "env FONTCONFIG_FILE=/path/to/font.conf firefox")
Offline
I tried changing the antialiasing in XFCE settings, but files in /etc/fonts were not altered (I checked with diff- -r). The setting seems to be in ~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml. This is a XFCE-specific file and does not seem like fontconfig one.
So it looks as if XFCE has some other mechanism in place which bypasses fontconfig? Or am I missing something?
I was hoping to create a separate configuration that would inherit the original and "override" just setting for antialiasing. So for example when I install new fonts, I don't have to manually update other configurations.
Is is still possible to do it like this? Or do I have to make a complete copy of /etc/fonts and maintain it (i.e. copy + patch every time)?
Last edited by bachtiar (2017-11-01 20:29:26)
Offline
Did you read the link?
$XDG_CONFIG_HOME defaults to ~/.config
Offline
Yes, I've read it, but I don't have per-user fontconfig neither in ~/.config/fontconfig nor in ~/.fontconfig. That's why I'm confused...
Offline
strace the xfce config dialog - it will write the config somewhere (because fontconfg needs to read it) - maybe the deprecated ~/.fonts.conf* ??
Offline
I did "strace xfce4-appearance-settings" but I'm not sure what I should look for. It opens /etc/fonts/**/*.conf alright, but with O_RDONLY.
It tries ~/.fonts, ~/.config/fontconfig, ~/.local/share/fonts, ~/.fonts, but none of them exist.
It also opens several files in /var/cache/fontconfig/.
The file that is changed by toggling the checkbox is ~/.config/xfce4/xfconf/xfce-perchannel-xml/xsettings.xml (found by manual diff -r .config config_old). As I understand, this is part of XFCE settings registry and is managed by xfce-settings. I can see some "sendmsg" in strace output that has the string "Antialias", though. But no clue about how it works with fontconfig.
Last edited by bachtiar (2017-11-01 21:13:13)
Offline
It probably talks to xfsettingsd but I fail to imagine how other (fontconfig driven) clients would pick the settings if it doesn't write the fontconfig files - unless xfce exports it's own FONTCONFIG environment?
env | grep FONTCONFIGOffline
It probably talks to xfsettingsd but I fail to imagine how other (fontconfig driven) clients would pick the settings if it doesn't write the fontconfig files - unless xfce exports it's own FONTCONFIG environment?
env | grep FONTCONFIG
No FONTCONFIG either...
Anyway, I tried making a /tmp/fonts.conf like this:
<fontconfig>
<include>/etc/fonts/fonts.conf</include>
<match target="font" >
<edit mode="assign" name="antialias"><bool>true</bool></edit>
</match>
</fontconfig>When I start "FONTCONFIG_FILE=/tmp/fonts.conf firefox", it works to a certain extent (i.e. enables antialiasing), but rendering of fonts is notably worse that when I enable antialiasing in XFCE settings. I've also tried giving a value for hinting and hintstyle, but it just isn't the same...
Any ideas?
Last edited by bachtiar (2017-11-01 21:50:40)
Offline
Autohinter, subpixel rendering, lcd filter ... hard to guess from "notably worse" ;-)
Offline
Yeah, that sucks... I've tried setting those options to what I assume XFCE uses, but no luck so far... Perhaps you know of a program that I could run to display effective fontconfig settings so I could replicate them exactly?
Last edited by bachtiar (2017-11-01 22:49:52)
Offline
FC_DEBUG=5120 goodlookingxfceclientThis will print the loaded fontconfig files and the applied transformations (but *not* write you an xml pattern)
Offline
That worked. Thanks.
But I'm still puzzled by one thing: how does XFCE communicate effective fontconfig settings to programs?
No XDG_CONFIG_HOME or FONTCONFIG_* variables in environment, no ~/.config/fontconfig, no ~/.fonts.conf, no ~/.fontconfig, no changes in /etc/fonts and no includes from /etc/fonts to anything from XFCE. What the hell?
Could this be something with gtk or even systemd or dbus?
Last edited by bachtiar (2017-11-02 07:38:56)
Offline
I've no idea, but the above command should tell your which config files are read by fontconfig. (Actually "FC_DEBUG=1024" does)
In theory the client could configure fonts directly based on some private configuration, but that sounds like a flawed approach.
Offline
It only prints stuff from /etc/fonts, which I've checked does not change.
According to this article, some programs get their settings directly from xfsettingsd. But it really looks like a mystery. If somebody who can explain this stumbles upon this question, please let me know...
Offline