Fonts/zh-cn: Difference between revisions

ZhX589 (talk | contribs)
Created page with "Nix 会将其用户配置文件路径插入到 <code>$XDG_DATA_DIRS</code> 中,而 Fontconfig 默认并不在此路径中查找。这会导致 KDE Plasma 等图形应用程序无法识别通过 <code>nix-env</code> 或 <code>nix profile</code> 安装的字体。"
ZhX589 (talk | contribs)
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> 安装的字体。


<div lang="en" dir="ltr" class="mw-content-ltr">
要解决此问题,请将 <code>100-nix.conf</code> 文件添加到 Fontconfig 用户配置目录中(通常为 <code>$XDG_CONFIG_HOME/fontconfig/conf.d</code>):
To solve this, add the file <code>100-nix.conf</code> to your Fontconfig user configuration directory (usually <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 is the path to your Nix profile. See Nix Reference Manual for details. -->
   <!-- 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>
and run <code>fc-cache</code>.
然后运行 <code>fc-cache</code>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">