启动安装了 nix 的 emacs 时出现字体配置错误

Dar*_*man 5 emacs fontconfig nix

我使用的是 Ubuntu 19.10。我有 nix 版本 2.3.1。我使用以下命令安装了 emacs 26.3:

nix-env -iA nixpkgs.emacs
Run Code Online (Sandbox Code Playgroud)

当我启动 emacs 时,我收到以下错误消息:

(process:9100): Gtk-WARNING **: 09:41:39.668: Locale not supported by C library.
Using the fallback 'C' locale.
Gtk-Message: 09:41:39.756: Failed to load module "canberra-gtk-module"
Gtk-Message: 09:41:39.756: Failed to load module "canberra-gtk-module"
Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf
Run Code Online (Sandbox Code Playgroud)

有什么方法可以解决这个问题吗?

Hen*_*nke 2

这里的问题是 nixpkgs 中的 Emacs 是根据比 Ubuntu 附带的版本 (2.13.1) 稍旧的 fontconfig (2.12.6) 版本构建的。但是,Emacs 的 fontconfig 2.12.6 尝试读取/etc/fonts/fonts.conf由主机系统的 fontconfig 2.13.1 安装的字体。同时,一些附加字段已添加到旧版本无法理解的配置中。

在我的系统上,我只是删除了有问题的线路/etc/fonts/fonts.conf,还没有遇到任何不利影响。