Firefox和IE9在Windows上呈现的字体不正确



我在我的网站上使用web字体Bitter。最初,我从谷歌网页字体中嵌入了它,但谷歌Chrome/Win没有正确地渲染.woff(它在较小的尺寸上有奇怪的锯齿状瑕疵)。在谷歌上搜索了一下后,我发现Chrome/win通常会遇到这种格式的问题,使用SVG可以解决这个问题。这意味着我必须自己托管/嵌入文件,而不是使用谷歌网络字体。我使用Font Squirrel获得了正确的@Font face代码,在我在Windows上的IE9/Firefox中测试之前,一切似乎都很好。两个浏览器都将大写字母T呈现得比其他大写字母小(如下http://d.pr/i/LIty)

这是我的字体识别码

@font-face {
    font-family: 'bitter';
    src: url('fonts/bitter-regular-webfont.eot');
    src: url('fonts/bitter-regular-webfont.eot?#iefix') format('embedded-opentype'),
         url('fonts/bitter-regular-webfont.svg#bitterregular') format('svg'),
         url('fonts/bitter-regular-webfont.ttf') format('truetype'),
         url('fonts/bitter-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'bitter';
    src: url('fonts/bitter-bold-webfont.eot');
    src: url('fonts/bitter-bold-webfont.eot?#iefix') format('embedded-opentype'),
         url('fonts/bitter-bold-webfont.svg#bitterbold') format('svg'),
         url('fonts/bitter-bold-webfont.ttf') format('truetype'),
         url('fonts/bitter-bold-webfont.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Bitter';
    src: url('fonts/bitter-italic-webfont.eot');
    src: url('fonts/bitter-italic-webfont.eot?#iefix') format('embedded-opentype'),
         url('fonts/bitter-italic-webfont.svg#bitteritalic') format('svg'),
         url('fonts/bitter-italic-webfont.ttf') format('truetype'),
         url('fonts/bitter-italic-webfont.woff') format('woff');
    font-weight: normal;
    font-style: italic;
}

我如何理解这种嵌入,浏览器使用他们可以接受的第一个文件格式,然后忽略其余的?如果我没有记错浏览器兼容性,那就意味着IE使用EOT,Chrome使用SVG,Firefox使用TTF。所以一开始,实际文件似乎有问题,但Firefox在Mac上的字体表现得很好。

你可以在现场观看http://dev.thesmackpack.com.我能做些什么来修复字体文件,或者让它们使用正确的格式吗?

编辑:我从原始创建者那里下载了一份字体副本,并通过font Squirrel生成器运行它,取消选中修改文件的所有选项。T是固定的,但现在坏的渲染伪影出现在FF和IE中。http://d.pr/i/5sVT

遗憾的是,我无法找到这个问题的充分解决方案。我切换回Google Web字体版本(有锯齿状的瑕疵,但没有破碎的字母大小),并改变了字体大小以最大限度地减少瑕疵(在特定大小上更糟)。这仍然不太好,但这是我能做的最好的。

在这里可以学到的教训:在开始开发之前,在所有操作系统的所有浏览器上测试各种大小的web字体。

最新更新