Open kirelagin opened 9 years ago
By the way, my system fontconfig (which includes ~/.config/fontconfig/fonts.conf
and is told there to check the ~/.nix-profile/share/fonts
directory) works fine:
› fc-cache -v | grep nix-profile
/home/kirrun/.nix-profile/share/fonts: skipping, existing cache is valid: 0 fonts, 1 dirs
/home/kirrun/.nix-profile/share/fonts/opentype: skipping, existing cache is valid: 7 fonts, 0 dirs
Re-scanning /home/kirrun/.nix-profile/share/fonts: caching, new cache contents: 0 fonts, 1 dirs
@kirelagin I haven't understood the difference between the first comment and the second.
@lethalman The first one uses fc-cache
from the nix store, the second one uses the system fc-cache
(this is not NixOS). I’m just trying to say that the directory is there and the fonts are visible. I don’t understand why fontconfig from the store doesn’t even try to read the directory, since it’s clearly told to do so in its config.
Ok, I got it.
The problem is fontconfig being horribly inconsistent. It reads my system fonts.conf
but assumes that the config directory is in $out
, so when it sees <include ignore_missing="yes">conf.d</include>
in my system config it goes to $out/etc/fonts/conf.d
and reads configs from there.
Since here on Gentoo user config is included from /etc/fonts/conf.d/50-user.conf
, my user config is actually never getting included.
It should definitely be reading files only from one source. As far as I can tell, by default it would be reading everything (including fonts.conf
) from $out/etc/fonts/
and this does make sense in my opinion, but this patch breaks this. @vcunat
If the intention was to let NixOS have its completely separate fonts configuration, then, keeping in mind the fact that we definitely want working fontconfig on non-NixOS, it might be better to:
$out
by default,/etc
via config.environment
right now?),$FONTCONFIG_FILE
and $FONTCONFIG_PATH
.We don't want NixOS to have separate fonts configuration. The only reason for those patches is to work around fontconfig version incompatibilities (requiring us to have different config files for 2.10 and 2.11, IIRC).
I guess we just need to build Fontconfig with --sysconfdir=/etc
to ensure <include ignore_missing="yes">conf.d</include>
is resolved properly on Gentoo.
@edolstra yes that should be sufficient. We use absolute paths in our fonts.conf so it won't be a problem.
This probably means that fontconfig in nixpkgs shouldn’t ship any kind of fonts.conf
.
On other distros the config will be already present in /etc
and on NixOS the fontconfig module will generate one.
Ping all.
So, what this all fontconfig 2.10 thing is about? I don’t see it being used anywhere in nixpkgs. Can’t we just drop this backward compatibility, the patch and forget about the issue? @edolstra @lethalman
That should be unrelated to the problems described in the title. It's to support running stuff built previously against fontconfig 2.10.
Just as a tide-over for others experiencing this, I modified my /etc/fonts/fonts.conf, to use the absolute path to the conf.d folder, it isn't a great fix, but it saves me from experiencing Oswalds Font everywhere!
@SevereOverfl0w : Thank you for the workaround, it worked for me too.
I'm non-root on a non-NixOS system trying to view pdfs that stem from Microsoft office. I could finally properly view the pdfs via:
nix-env -iA nixpkgs.corefonts
and symlinking the fonts to ~/.local/share/fonts
via:
ln -sf ~/.nix-profile/share/fonts/ ~/.local/share/fonts/nix-fonts
It's too bad this issue is still open, I'll confirm though that @knedlsepp's workaround is working so thanks!
I guess https://github.com/rycee/home-manager might also be a viable Option.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
(Not on NixOS.)
I’m not really sure why but, well, fontconfig ignores my
~/.nix-profile/share/fonts
.even though its config tells it to look there:
Any ideas?