Chrome 和 Firefox 上奇怪的字体字距问题

Chrome 和 Firefox 上奇怪的字体字距问题

自从去年切换到 Kubuntu 以来,我一直在使用 Ubuntu 存储库中的 Chromium,但是由于 Chrome Sync 被删除,我想切换到 Google Chrome - 但是我在 Chrome 中遇到了字体显示问题,而在 Chromium 中没有。Firefox 中也出现了类似的问题。我一直在寻找答案,但我发现的所有内容都涉及到每个浏览器的旧版本中的问题。对我来说,字体在 Chromium 上显示准确,但在 Chrome 和 Firefox 上,字母和文本之间的空间太大,Twitter 等网站上的文本似乎会出现故障和弹出。这在 Firefox 上最为严重,例如,将鼠标悬停在推文上就会导致文本扭曲,但 Chrome 也有类似的扭曲,尤其是在加载页面时。

在此处输入图片描述

我在 Kubuntu 20.10 上使用 Chromium 89.0.4389.90(官方版本)snap(64 位)、Google Chrome 89.0.4389.90(官方版本)(64 位)、Firefox 86.0(64 位)。

答案1

为了扩展 Gunnar 的回答,我通过注释掉以下段落来改善字体字距问题56-kubuntu-noto-conf

  <!-- Roboto is BCI-hinted for widely used LGC characters -->
  <match target="font">
    <test name="family"><string>Roboto</string></test>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="autohint" mode="assign"><bool>false</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
  </match>

仍然不知道为什么这是必要的——就我而言,我刚刚从 18.04 迁移到 20.04,那里没有这个问题。不过,上面的解决方法目前似乎效果很好。

答案2

Kubuntu 中的默认字体是诺托·桑斯。作为实验,您可能希望禁用 Noto 配置,然后恢复到DejaVu Sans

cd /etc/fonts/conf.avail
sudo mv 56-kubuntu-noto.conf 56-kubuntu-noto.conf.disabled

相关内容