我在我的页面上使用了自定义的webfont,并且在不同的平台上有一些渲染问题。在Linux和Windows中,块中文本的对齐方式有些不同。这里有一个例子:Webfont位置渲染问题
的Chrome在Linux中:
的Chrome在Windows:
他们正在使用的字体(OTF)的相同版本都,样式都一模一样(相同的线条高度和边距)。
这里的字体面源:
@font-face {
font-family: 'Calibre Regular';
src: url('fonts/Calibre-Regular.eot') format('embedded-opentype'),
url('Calibre-Regular.otf') format('opentype'),
url('fonts/Calibre-Regular.woff') format('woff'),
url('fonts/Calibre-Regular.ttf') format('truetype'),
url('fonts/Calibre-Regular.svg#Calibre-Regular') format('svg');
font-weight: normal;
font-style: normal;
}
有什么办法解决?
看来你的代码有问题。但是,除非我们有[可以重现问题的代码或信息](http://stackoverflow.com/help/mcve),否则我们无法提供帮助。否则,我们只是盲目猜测。 – gunr2171 2014-09-19 14:31:33
这取决于它们是否都使用相同版本的字体 - 也就是说可以使用svg版本,另一个可以使用woff版本,在这种情况下,它们将呈现不同的效果。然后你需要检查默认的行高和元素的垂直对齐是相同的 - 行高看起来相同,但看起来是垂直对齐的中间和顶部 – Pete 2014-09-19 14:43:56
我也有这个问题,我终于发现它自己,它可能是对你的一些使用:http://stackoverflow.com/questions/7220937/why-does-my-custom-font-have-a-positional-offset-in-some-browsers。 – Gerard 2014-09-19 22:57:01