Answers:
这似乎是Chromium中使用Helvetica字体的错误。这里讨论:
https://forums-web1.gentoo.org/viewtopic-t-984870.html?sid=d8fa5b8fc9ae0c83520d1769dc366d58
从该线程中,此解决方案为我修复了该问题:
manifest.json
{
"name": "Fix Helvetica",
"description": "Fix Helvetica",
"version": "0.1",
"content_scripts": [ {
"css": [ "Custom.css" ],
"matches": [ "http://*/*", "https://*/*" ]
} ],
"manifest_version": 2
}
Custom.css
@font-face { font-family: 'Helvetica'; src: local('Arial')}
我正在运行Ubuntu 12.04,并且遇到了同样的问题。从/etc/fonts/conf.d中删除所有70年代的配置并进行链接
70-no-bitmaps.conf -> ../conf.avail/70-no-bitmaps.conf
和检查后,xml中的selectfont元素没有被注释掉,看起来我的字体又很好地呈现了。
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Reject bitmap fonts -->
<selectfont>
<rejectfont>
<pattern>
<patelt name="scalable"><bool>false</bool></patelt>
</pattern>
</rejectfont>
</selectfont>
</fontconfig>
fc-cache -fv
我不想通过启用禁用位图字体70-no-bitmaps.conf
,因为我在xfce4-terminal(即Fixed
字体)中使用它们。所以我找到了解决方案29-replace-bitmap-fonts.conf
/etc/fonts/conf.avail/29-replace-bitmap-fonts.conf:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Replace generic bitmap font names by generic font families.
These font-families will get replaced by other rules and
default to scaled ones. -->
<match target="pattern" name="family">
<test name="family" qual="any">
<string>Helvetica</string>
</test>
<edit mode="assign" name="family">
<string>Arial</string>
<string>Liberation Sans</string>
<string>sans-serif</string>
</edit>
</match>
</fontconfig>
然后,我启用了此配置:
ln -s /etc/fonts/conf.avail/29-replace-bitmap-fonts.conf /etc/fonts/conf.d/29-replace-bitmap-fonts.conf
对于Gentoo用户:
eselect fontconfig enable 29-replace-bitmap-fonts.conf
最近,我在XFCE的Debian(测试)上使用Chrome浏览器遇到同样的问题。我刚刚将以下代码添加到.fonts.conf
了主目录中的文件中:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="antialias" mode="assign"><bool>true</bool></edit>
</match>
<match target="font">
<edit name="hintstyle" mode="assign"><const>hintnone</const></edit>
</match>
<match target="font">
<edit mode="assign" name="hinting"><bool>false</bool></edit>
</match>
</fontconfig>
该代码基本上禁用了提示并启用了抗锯齿功能。现在,一切都像魅力一样。
(来源)