我最近将操作系统从 Ubuntu 16.04 升级到了 18.04。我正在尝试更改 Ubuntu 18.04 中特定于语言的字体。
放置一个包含以下内容的配置文件/etc/fonts/conf.d/69-language-selector-fa.conf
并重新加载我的设置。
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="lang" compare="contains">
<string>fa</string>
</test>
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Vazir</string>
</edit>
</match>
<match target="pattern">
<test name="lang" compare="contains">
<string>fa</string>
</test>
<test qual="any" name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Vazir</string>
</edit>
</match>
</fontconfig>
但我仍然得到以下输出:
╰─○ LANG=fa fc-match
DejaVuSans.ttf: "DejaVu Sans" "Book"
或者
╰─○ LANG=fa_IR fc-match
DejaVuSans.ttf: "DejaVu Sans" "Book"
或者(更新)
╰─± fc-match -a | head -10
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSansCondensed.ttf: "DejaVu Sans" "Condensed"
DejaVuSans-ExtraLight.ttf: "DejaVu Sans" "ExtraLight"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"
DejaVuSansCondensed-Bold.ttf: "DejaVu Sans" "Condensed Bold"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"
DejaVuSansCondensed-Oblique.ttf: "DejaVu Sans" "Condensed Oblique"
DejaVuSans-BoldOblique.ttf: "DejaVu Sans" "Bold Oblique"
DejaVuSansCondensed-BoldOblique.ttf: "DejaVu Sans" "Condensed Bold Oblique"
n019003l.pfb: "Nimbus Sans L" "Regular
看来 Ubuntu 18.04 没有加载我的配置文件。顺便说一句,Vazir 字体已安装并显示在字体管理器中。