Fonts/zh-cn: Difference between revisions
Created page with "或者,在您的 Home Manager 配置 <code>opt-fonts.fontconfig.enable</code> 中启用 Fontconfig 配置。" |
Created page with "=== 在 <code>fonts.fontconfig.defaultFonts.monospace</code> 中可以使用哪些字体名称? ===" |
||
| (9 intermediate revisions by the same user not shown) | |||
| Line 109: | Line 109: | ||
或者,在您的 Home Manager 配置 <code>opt-fonts.fontconfig.enable</code> 中启用 Fontconfig 配置。 | 或者,在您的 Home Manager 配置 <code>opt-fonts.fontconfig.enable</code> 中启用 Fontconfig 配置。 | ||
=== 命令式安装用户字体 === | |||
<span lang="en" dir="ltr" class="mw-content-ltr">This is useful for quick font experiments.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">This is useful for quick font experiments.</span> | ||
| Line 152: | Line 152: | ||
</div> | </div> | ||
== 配置字体 == | |||
NixOS 的 [https://search.nixos.org/options?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=fonts.fontconfig <code>fonts.fontconfig</code>] 配置项(点击查看完整列表!)用于处理 fontconfig 选项。部分选项已被 nix 很好地封装;此外始终可以使用 <code>localConf</code> 直接编写 XML 配置。 | |||
=== 为不同语言设置多种字体 === | |||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
If you want to use other languages alongside English, you may want to set appropriate fonts for each language in your whole OS. For example, a Persian speaker might want to use the | If you want to use other languages alongside English, you may want to set appropriate fonts for each language in your whole OS. For example, a Persian speaker might want to use the | ||
| Line 195: | Line 193: | ||
</div> | </div> | ||
=== 使用自定义字体替换 === | |||
有时,由于不恰当的替换,文档可能会出现字距不佳或字间距难以阅读的问题。 | |||
例如,Okular 可能在“文档属性”对话框中显示已将 DejaVu Sans Mono(一种无衬线字体)替换为 "NewCenturySchlbk"。运行 <code>fc-match NewCenturySchlbk</code> 会显示类似信息。 | |||
将此添加到您的 <code>/etc/nixos/configuration.nix</code> 中,应能促使其改用更相似(且更美观)的衬线字体 ''Schola'' 作为替代: | |||
{{File|3=fonts = { | {{File|3=fonts = { | ||
packages = with pkgs; [ gyre-fonts ]; | packages = with pkgs; [ gyre-fonts ]; | ||
| Line 219: | Line 212: | ||
}; | }; | ||
};|name=/etc/nixos/configuration.nix|lang=nix}} | };|name=/etc/nixos/configuration.nix|lang=nix}} | ||
有关 XML 配置语言的更多信息和示例: | |||
* https://www.mankier.com/5/fonts-conf | * https://www.mankier.com/5/fonts-conf | ||
| Line 229: | Line 219: | ||
* https://wiki.archlinux.org/index.php/Font_configuration/Examples | * https://wiki.archlinux.org/index.php/Font_configuration/Examples | ||
有关合适的替代字体列表: | |||
* https://wiki.archlinux.org/title/Metric-compatible_fonts | * https://wiki.archlinux.org/title/Metric-compatible_fonts | ||
== 故障排除 == | |||
=== 在 <code>fonts.fontconfig.defaultFonts.monospace</code> 中可以使用哪些字体名称? === | |||
<span lang="en" dir="ltr" class="mw-content-ltr">Those that fontconfig will understand. This can be queried from a font file using <code>fc-query</code>.</span> | <span lang="en" dir="ltr" class="mw-content-ltr">Those that fontconfig will understand. This can be queried from a font file using <code>fc-query</code>.</span> | ||