Fonts/zh-cn: Difference between revisions
Created page with "Nix 会将其用户配置文件路径插入到 <code>$XDG_DATA_DIRS</code> 中,而 Fontconfig 默认并不在此路径中查找。这会导致 KDE Plasma 等图形应用程序无法识别通过 <code>nix-env</code> 或 <code>nix profile</code> 安装的字体。" |
Created page with "要解决此问题,请将 <code>100-nix.conf</code> 文件添加到 Fontconfig 用户配置目录中(通常为 <code>$XDG_CONFIG_HOME/fontconfig/conf.d</code>): <syntaxhighlight lang="xml"> <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> <fontconfig> <!-- NIX_PROFILE 是您的 Nix 配置文件的路径。详见 Nix 参考手册。 --> <dir>NIX_PROFILE/lib/X11/fonts</dir> <dir>NIX_PROFILE/share/fonts</dir> </fontconfig> </syntax..." |
||
| Line 95: | Line 95: | ||
Nix 会将其用户配置文件路径插入到 <code>$XDG_DATA_DIRS</code> 中,而 Fontconfig 默认并不在此路径中查找。这会导致 KDE Plasma 等图形应用程序无法识别通过 <code>nix-env</code> 或 <code>nix profile</code> 安装的字体。 | Nix 会将其用户配置文件路径插入到 <code>$XDG_DATA_DIRS</code> 中,而 Fontconfig 默认并不在此路径中查找。这会导致 KDE Plasma 等图形应用程序无法识别通过 <code>nix-env</code> 或 <code>nix profile</code> 安装的字体。 | ||
要解决此问题,请将 <code>100-nix.conf</code> 文件添加到 Fontconfig 用户配置目录中(通常为 <code>$XDG_CONFIG_HOME/fontconfig/conf.d</code>): | |||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> | <!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> | ||
<fontconfig> | <fontconfig> | ||
<!-- NIX_PROFILE | <!-- NIX_PROFILE 是您的 Nix 配置文件的路径。详见 Nix 参考手册。 --> | ||
<dir>NIX_PROFILE/lib/X11/fonts</dir> | <dir>NIX_PROFILE/lib/X11/fonts</dir> | ||
<dir>NIX_PROFILE/share/fonts</dir> | <dir>NIX_PROFILE/share/fonts</dir> | ||
</fontconfig> | </fontconfig> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
然后运行 <code>fc-cache</code>。 | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||