@font-face 和 opentype 字体的 bbox 或血统错误

发布于 2024-10-09 20:14:55 字数 424 浏览 0 评论 0原文

我用@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.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

儭儭莪哋寶赑 2024-10-16 20:14:55

同样的情况也发生在我身上,并且在使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文