更换为可变字重版本后字重变正常了.
原帖:
大家好.
我正在使用 Plasma KDE, 并且在 Konsole 上使用 vim. 我发现 vim 和 gvim 渲染的中文字体不同. 更准确地说, 运行在 konsole 中的 vim 中文字体明显比在 gvim 中的粗.
我后来发现, 不仅是 Konsole 和 gvim, 在所有 KDE 程序中 (比如 Dolphin), 中文字体渲染都如同 Konsole, 而在 GTK 程序中 (如 Firefox 和 Thunderbird), 中文字体渲染都如同 gvim.
此外, 可以发现 KDE 程序和 GTK 程序中英文字体的形状也不相同 (尽管他们都使用 Monospace 11pt 字体).
我更希望 KDE 程序将中文渲染得更轻 (以更好的和英文字体匹配). 经过网上搜索, 我发现了一位日语用户也遇到了类似的问题. 但是在那个帖子中似乎没有给出好的解决方案 (需要换字体).
以下是 (我觉得相关的) 字体设置. 如果需要其他的信息, 我很高兴提供.
<match target="font">
<edit name="antialias" mode="assign"><bool>true</bool></edit>
<edit name="hinting" mode="assign"><bool>true</bool></edit>
<edit name="hintstyle" mode="assign"><const>hintslight</const></edit>
<edit name="rgba" mode="assign"><const>none</const></edit>
<edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
</match>
<!-- 对思源黑体和思源宋体不使用 hinting. 因为 hinting 会使中文字体过大 (hintfull)
或者过高 (hintslight). 这应该和本帖所说问题无关, 因为我将其删除也没有什么改变. -->
<match target="font">
<test qual="any" name="family"><string>Source Han Sans</string></test>
<edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
</match>
<!-- 对 Source Han Sans SC/K/TC, Source Han Serif 等字体也做类似设置 -->
<!-- 西文字体 -->
<match target="pattern">
<test qual="any" name="family"><string>sans-serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>monospace</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Fira Code</string>
</edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>serif</string></test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif</string>
</edit>
</match>
<!-- CJK 字体 -->
<match target="pattern">
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif SC</string>
</edit>
</match>
<!-- Japanese -->
<!-- "lang=ja" or "lang=ja-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>ja</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif</string>
</edit>
</match>
<!-- Korean -->
<!-- "lang=ko" or "lang=ko-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>ko</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif K</string>
</edit>
</match>
<!-- Chinese -->
<!-- "lang=zh" or "lang=zh-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif SC</string>
</edit>
</match>
<!-- "lang=zh-hans" or "lang=zh-hans-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-hans</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif SC</string>
</edit>
</match>
<!-- "lang=zh-hant" or "lang=zh-hant-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-hant</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif TC</string>
</edit>
</match>
<!-- "lang=zh-hant-hk" or "lang=zh-hant-hk-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-hant-hk</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif HC</string>
</edit>
</match>
<!-- Compatible -->
<!-- "lang=zh-cn" or "lang=zh-cn-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-cn</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif SC</string>
</edit>
</match>
<!-- "lang=zh-tw" or "lang=zh-tw-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-tw</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif TC</string>
</edit>
</match>
<!-- "lang=zh-hk" or "lang=zh-hk-*" -->
<match target="pattern">
<test name="lang" compare="contains">
<string>zh-hk</string>
</test>
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="append" binding="strong">
<string>Source Han Serif HC</string>
</edit>
</match>
<!-- 对 sans-serif, monospace, system-ui 做类似设置 -->
我将系统语言修改为了中文, 发现了更加诡异的事情.
在 Plasma Shell 和系统设置里, 字体的字重是令人满意的. 然而, 渲染的时候使用了 RGB 子像素渲染 (而我在系统设置和 /etc/fonts/local.conf 设置的是灰度)
在 Konsole, Dolphin 和 Gwenview 里, 字体正确禁用字像素渲染而启用灰度. 然而, 思源黑体字体更粗.



