Mat*_*iak 6 fonts etc fontconfig
我正在调整 Arch Linux 中的一些字体设置。我在其中创建了一个新.conf文件/etc/fonts/conf.avail/并将其符号链接到/etc/fonts/conf.d. 我现在想测试这些更改。我试过运行fc-cache -rv并重新启动终端。据我所知,我的更新没有被应用。
Arch Linux wiki 指出:
Fontconfig 将其所有配置收集在一个中央文件 (/etc/fonts/fonts.conf) 中。该文件在 fontconfig 更新期间被替换,不应被编辑。Fontconfig-aware 应用程序从这个文件中获取可用的字体以及它们是如何呈现的。该文件是全局配置 (/etc/fonts/local.conf) 中的规则、/etc/fonts/conf.d/ 中配置的预设以及用户配置文件 ($XDG_CONFIG_HOME/fontconfig/fonts.conf) 的集合)。fc-cache 可用于重建 fontconfig 的配置,但更改仅在新启动的应用程序中可见。
但是,我fonts.conf不看像一个聚集。
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
<!--
DO NOT EDIT THIS FILE.
IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED.
LOCAL CHANGES BELONG IN 'local.conf'.
The intent of this standard configuration file is to be adequate for
most environments. If you have a reasonably normal environment and
have found problems with this configuration, they are probably
things that others will also want fixed. Please submit any
problems to the fontconfig bugzilla system located at fontconfig.org
Note that the normal 'make install' procedure for fontconfig is to
replace any existing fonts.conf file with the new version. Place
any local customizations in local.conf which this file references.
Keith Packard
-->
<!-- Font directory list -->
<dir>/usr/share/fonts</dir>
<dir>/usr/share/fonts</dir>
<dir prefix="xdg">fonts</dir>
<!-- the following element will be removed in the future -->
<dir>~/.fonts</dir>
<!--
Accept deprecated 'mono' alias, replacing it with 'monospace'
-->
<match target="pattern">
<test qual="any" name="family">
<string>mono</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>monospace</string>
</edit>
</match>
<!--
Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
-->
<match target="pattern">
<test qual="any" name="family">
<string>sans serif</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>sans-serif</string>
</edit>
</match>
<!--
Accept deprecated 'sans' alias, replacing it with 'sans-serif'
-->
<match target="pattern">
<test qual="any" name="family">
<string>sans</string>
</test>
<edit name="family" mode="assign" binding="same">
<string>sans-serif</string>
</edit>
</match>
<!--
Load local system customization file
-->
<include ignore_missing="yes">conf.d</include>
<!-- Font cache directory list -->
<cachedir>/var/cache/fontconfig</cachedir>
<cachedir prefix="xdg">fontconfig</cachedir>
<!-- the following element will be removed in the future -->
<cachedir>~/.fontconfig</cachedir>
<config>
<!--
Rescan configuration every 30 seconds when FcFontSetList is called
-->
<rescan>
<int>30</int>
</rescan>
</config>
</fontconfig>
Run Code Online (Sandbox Code Playgroud)
我希望它能让我看到最终组合的字体设置集是什么。
我试过运行 fc-cache -rv 并重新启动终端。据我所知,我的更新没有被应用。
重新启动应用程序应该足以重新加载更改。一些应用程序甚至无需重新启动即可定期重新加载配置。
fc-cache 据我所知,通常对配置更改无用。
如果您的更改似乎没有应用,可能是因为没有匹配,或者如果匹配,则规则不够强大而无法应用。
我建议添加类似这样的东西来进行无条件的、强约束的、非常明显的变化:
<match target="pattern">
<edit name="family" mode="prepend" binding="strong">
<string>Comic Sans MS</string>
</edit>
</match>
Run Code Online (Sandbox Code Playgroud)
当你的眼睛开始流血时,你可以说它起作用了。
请注意,即使如此,在此之后评估的规则可能会进一步修改此模式。
我还使用了拒绝字体块,它似乎比其他任何东西都具有更高的优先级,但是处理特定的 TTF 文件,因此您需要知道匹配的FC_DEBUG=1是什么(就足够了)
<selectfont>
<rejectfont>
<glob>/usr/share/fonts/TTF/DejaVuSans.ttf</glob>
</rejectfont>
</selectfont>
Run Code Online (Sandbox Code Playgroud)
问题的另一部分:
然而,我的
fonts.conf看起来不像一个集团。
神奇之处在于<include ignore_missing="yes">conf.d</include>其中包括其他一切。
这是我的系统中的样子:
$ FC_DEBUG=1024 leafpad
Loading config file /etc/fonts/fonts.conf
Scanning config dir /etc/fonts/conf.d
Loading config file /etc/fonts/conf.d/10-hinting-slight.conf
Loading config file /etc/fonts/conf.d/10-scale-bitmap-fonts.conf
Loading config file /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf
Loading config file /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf
Loading config file /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf
Loading config file /etc/fonts/conf.d/20-unhint-small-vera.conf
Loading config file /etc/fonts/conf.d/30-metric-aliases.conf
Loading config file /etc/fonts/conf.d/30-urw-aliases.conf
Loading config file /etc/fonts/conf.d/30-win32-aliases.conf
Loading config file /etc/fonts/conf.d/40-nonlatin.conf
Loading config file /etc/fonts/conf.d/45-latin.conf
Loading config file /etc/fonts/conf.d/49-sansserif.conf
Loading config file /etc/fonts/conf.d/50-user.conf
Scanning config dir /home/dx/.config/fontconfig/conf.d
Loading config file /home/dx/.config/fontconfig/conf.d/10-powerline-symbols.conf
Loading config file /home/dx/.config/fontconfig/fonts.conf
Loading config file /home/dx/.fonts.conf
Loading config file /etc/fonts/conf.d/51-local.conf
Loading config file /etc/fonts/local.conf
Loading config file /etc/fonts/conf.d/57-dejavu-sans-mono.conf
Loading config file /etc/fonts/conf.d/57-dejavu-sans.conf
Loading config file /etc/fonts/conf.d/57-dejavu-serif.conf
Loading config file /etc/fonts/conf.d/60-latin.conf
Loading config file /etc/fonts/conf.d/65-fonts-persian.conf
Loading config file /etc/fonts/conf.d/65-nonlatin.conf
Loading config file /etc/fonts/conf.d/69-unifont.conf
Loading config file /etc/fonts/conf.d/75-fix-calibri.conf
Loading config file /etc/fonts/conf.d/80-delicious.conf
Loading config file /etc/fonts/conf.d/90-synthetic.conf
Run Code Online (Sandbox Code Playgroud)