@font-face 和 opentype 字体的 bbox 或血统错误
我用@font-face嵌入了opentype字体。工作正常,但 bbox 或下降(或基线/下降线?)在某些浏览器/操作系统上是错误的。问题是,例如,在 Mac 上,bbox 不正确,这意味着要使文本在 bbox 中居中,我必须为段落设置填充。我猜该字体是在 Windows 上创建的,并未在 Linux 和 OS X 上进行测试,并且这些操作系统中的字体渲染引擎的工作方式有所不同。
知道如何解决问题吗?
Windows、Linux 和 Mac 中的字体屏幕截图。从上到下依次为:Ubuntu Firefox 3、Chromium、Windows XP Firefox 3/Chrome、Mac OS X Safari 5/Firefox 4 Beta 8。
I embedded a opentype font with @font-face. Works fine, but the bbox or descent (or baseline/descent line?) is wrong on certain browsers/OSs. The problem is e.g. on a Mac the bbox is not right, that means to center the text in it's bbox I have to set a padding to the paragraph. I guess the font was created on Windows and was not tested on Linux and OS X, and the font rendering engines in these OSs work diffrently.
Any idea how to solve withs problem?
Screenshot of the font in Windows, Linux and Mac. Form top to bottom: Ubuntu Firefox 3, Chromium, Windows XP Firefox 3/Chrome, Mac OS X Safari 5/Firefox 4 Beta 8.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
同样的情况也发生在我身上,并且在使用 http:// 将字体转换为 woff、eot 等时引入了问题www.fontsquirrel.com/fontface/generator。
“修复垂直度量”选项实际上破坏了字体高度。取消选中此选项解决了问题。
The same happened to me and the problem was introduced when converting the font to woff, eot, etc using http://www.fontsquirrel.com/fontface/generator.
The option "Fix Vertical Metrics" actually ruined the font height. Unchecking this option solved the problem.