【发布时间】:2018-07-03 06:41:49
【问题描述】:
我使用了这个代码:
@font-face {
font-family: 'DroidSansRegular';
src: url('droidsans-webfont.eot');
src: url('droidsans-webfont.eot?#iefix') format('embedded-opentype'),
url('droidsans-webfont.woff') format('woff'),
url('droidsans-webfont.ttf') format('truetype'),
url('droidsans-webfont.svg#DroidSansRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'DroidSansBold';
src: url('droidsans-bold-webfont.eot');
src: url('droidsans-bold-webfont.eot?#iefix') format('embedded-opentype'),
url('droidsans-bold-webfont.woff') format('woff'),
url('droidsans-bold-webfont.ttf') format('truetype'),
url('droidsans-bold-webfont.svg#DroidSansBold') format('svg');
font-weight: bold;
font-style: normal;
}
当我使用font-weight: bold; 时,Chrome 中的粗体文本是可以的,但在 Firefox 中粗体太多了。
如何解决?
PS:我必须使用本地文件中的字体。
【问题讨论】:
-
afaik,每个主要浏览器都使用不同的渲染引擎,它们会以不同的方式显示文本......甚至每个字形的特定形状可能会有所不同,具体取决于 TrueType/OpenType 提示的多少算法实现了。
标签: css cross-browser font-face