Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot override fontconfig #1827

Closed
taku0 opened this issue Feb 24, 2014 · 7 comments
Closed

Cannot override fontconfig #1827

taku0 opened this issue Feb 24, 2014 · 7 comments
Assignees

Comments

@taku0
Copy link
Contributor

taku0 commented Feb 24, 2014

There is no way to add high-priority, system-wide fontconfig configuration file.

In conventional Linux systems, we can write /etc/fonts/conf.d/99-overrideall to override font configurations. (e.g. overriding 60-latain.conf or 65-nonlatain.conf to modify font priorities.)
We cannot utilize local.conf since it is loaded from 51-local.conf and is overridden by 60-latain and others.

/etc/fonts/fonts.conf includes both /etc/fonts/conf.d and ${fontconfig}/etc/fonts/conf.d, but /etc/fonts/conf.d is included before ${fontconfig}/etc/fonts/conf.d, so that all configurations in /etc/fonts/conf.d are overridden by configurations in ${fontconfig}/etc/fonts/conf.d.

Possible fixes

  • Add a NixOS option that generates ${fontconfig}/etc/fonts/conf.d/99-overrideall
  • Add a NixOS option that add/remove arbitrary files to/from ${fontconfig}/etc/fonts/conf.d/
  • Include /etc/fonts/conf.d after ${fontconfig}/etc/fonts/conf.d so that administrators can generate configuration files using environment.etc
@shlevy
Copy link
Member

shlevy commented Apr 5, 2014

IMO in general .d directories should be merged after the base config. @edolstra Any objections to making that switch here?

@7c6f434c
Copy link
Member

I'm also for the last option. Maybe we should do this already?

@vcunat
Copy link
Member

vcunat commented Jun 14, 2014

I thought all fontconfig *.d directories are processed in parallel, so adding 99-* into either should be able to override anything. I recently read the docs, but I'm not sure about this.

@vcunat
Copy link
Member

vcunat commented Jun 14, 2014

Hmm, if not, then it might be best to do some kind of buildEnv on the two config trees and use that one.

@taku0
Copy link
Contributor Author

taku0 commented Jun 15, 2014

@vcunat Unfortunately, *.d directories are not processed in parallel. Try FC_DEBUG=65535 fc-list or see FcConfigParseAndLoadDir @ src/fcxml.c

@vcunat vcunat self-assigned this Sep 28, 2014
@vcunat
Copy link
Member

vcunat commented Sep 28, 2014

The overriding of parts of config is no easy problem. For example, specified directories (fonts, cache) are used in the order they were specified, so one will typically want to add stuff before the defaults and not after them (or one may even want to remove/replace them).

@vcunat
Copy link
Member

vcunat commented Nov 5, 2014

I think this is fine now in staging. The following are loaded after the defaults:

  • system-wide /etc/fonts/{fontconfig.configVersion}/conf.d/* (you can add files in there by environment.etc.fonts...);
  • per-user XDG path ~/.config/fontconfig/conf.d/.

@vcunat vcunat closed this as completed Nov 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants