为什么iOS Safari添加额外的字母间距?

我想我已经find了谷歌字体在移动(iOS 8)Safari的networking渲染错误。 在我看来,Mobile Safari为所有使用Google字体的文本添加了一小部分字母间距,或者使用其他字体。 我尝试使用哪个Google字体(Open Sans)并不重要。 它在所有现代浏览器上正确渲染。 testing了Android,FF,Chrome,Safari。

试着在iOS设备上加载这个页面来看看我的意思。 另请参阅代码和屏幕截图。 查看此链接以进行实时评论: https : //dl.dropboxusercontent.com/u/430406/Temp%20%5Bok%20to%20delete%5D/Checking%20Font/index.html

<!DOCTYPE html> <html> <head> <title></title> <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'> </head> <body> <h2 style="font-family: 'Roboto'">Roboto: Looks like it gets a bit extra line-spacing in iOS Safari, though this is not possible to find in web inspector</h2> <h2 style="font-family: 'Arial'">Arial: Works fine in iOS Safari</h2> </body> </html> 

在这里输入图像说明

我在这个问题中find了解决scheme: iOS 4.2 + webfont(ttf)的粗体字重渲染错误

如果你没有设置font-weight(比如font-weight: 400或者font-weight: normal ),那么移动Safari会显示错误的字体重量。你需要专门设置css字体的重量,移动探险。

这是解决scheme。

 h2 { font-weight: 400; } 

请注意,Google Web Fonts默认只导出常规权重(400),这可能会导致Mobile Safari(和其他浏览器)被迫使用仿粗体。

要显式导出粗体重量,请在Google Web Font字体select窗格中select“CUSTOMIZE”,手动检查所需的每个额外重量,然后使用更新的embedded代码。

([屏幕截图:Google字体自定义窗格 ) ] 1