乍一看,它对我来说似乎是一个真正的fontconfig错误,因为它在这里正常工作,而且我确实安装了DejaVu和Unifont:
$ fc-match Sans
DejaVuSans.ttf: "DejaVu Sans" "Book"
$ fc-match "Sans"
DejaVuSans.ttf: "DejaVu Sans" "Book"
$ fc-match "Sans "
DejaVuSans.ttf: "DejaVu Sans" "Book"
$ fc-match "Sans 9"
DejaVuSans.ttf: "DejaVu Sans" "Book"
但是,仔细观察,我们可以看到更多细节。某个地方仍然可能存在fontconfig bug,但fc-match
显然在找不到任何东西时会返回默认值。在我的系统上,默认值为DejaVu:
$ fc-match uni
DejaVuSans.ttf: "DejaVu Sans" "Book"
$ fc-match unifont
Unifont.ttf: "unifont" "Medium"
$ fc-match 4e5zedrkbxp
DejaVuSans.ttf: "DejaVu Sans" "Book"
手册页fc-match(1)
确认该命令没有进行完全匹配,但返回了它认为最匹配的内容。您可以通过-a
以下更为简洁的方式查看它们-s
:
$ fc-match -s uni # now it also finds unifont
DejaVuSans.ttf: "DejaVu Sans" "Book"
DejaVuSans-Bold.ttf: "DejaVu Sans" "Bold"
DejaVuSans-Oblique.ttf: "DejaVu Sans" "Oblique"
DejaVuSans-BoldOblique.ttf: "DejaVu Sans" "Bold Oblique"
n019003l.pfb: "Nimbus Sans L" "Regular"
helvR12-ISO8859-1.pcf.gz: "Helvetica" "Regular"
FreeSans.ttf: "FreeSans" "нормален"
KanjiStrokeOrders.ttf: "KanjiStrokeOrders" "Medium"
Eadui.ttf: "Eadui" "Medium"
Unifont.ttf: "unifont" "Medium"
FreeSerif.ttf: "FreeSerif" "нормален"
cu12.pcf.gz: "ClearlyU" "Regular"
cu-pua12.pcf.gz: "ClearlyU PUA" "Regular"
10x20.pcf.gz: "Fixed" "Regular"
您可以在其上简单地说“拧紧您”,并在其上添加另一个搜索以符合您的期望:
$ fc-match -s uni | grep -i uni
Unifont.ttf: "unifont" "Medium"
但是,您的问题是关于匹配的精确程度。FcFontMatch(3)
并进一步粗略地确认它使用默认/配置值,并明确地确认它首先修改了您传递给它的搜索词。对于更深层次的内容,您将必须检查代码(从上述功能开始)。