@ font-face问题,Firefox添加了padding,Chrome没有 [英] @font-face problem, Firefox adds padding, Chrome does not

查看:177
本文介绍了@ font-face问题,Firefox添加了padding,Chrome没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过 @ font-face 使用自定义字体时,它会像Chrome一样显示。在Firefox中,字体中添加了额外的填充(顶部和底部)。

When using a custom font via @font-face, it does render just as I think it should in Chrome. In Firefox, though, additional padding (top and bottom) is added to the font.

这是我的示例页面,概述了问题

有什么我可以做吗? / p>

Is there anything I can do about it?

推荐答案

FYI,这也发生在Linux上的Firefox(而不是Chromium)。我尝试在 FontForge 中加载您的字体,并立即收到警告:

FYI, this also happens in Firefox on Linux (and not in Chromium). I tried to load your font in FontForge and immediately got a warning:


FontForge忽略了字体中的以下表格

忽略'LTSH '线性阈值表

忽略VDMX垂直设备指标表

忽略'hdmx'横向设备指标表

The following table(s) in the font have been ignored by FontForge
Ignoring 'LTSH' linear threshold table
Ignoring 'VDMX' vertical device metrics table
Ignoring 'hdmx' horizontal device metrics table

我认为问题是 VDMX(垂直设备指标)表有缺陷:

I think the problem is that the VDMX (Vertical Device Metrics) table is defect:


为了避免网格匹配
整个字体以确定正确的
高度,VDMX表已定义

In order to avoid grid fitting the entire font to determine the correct height, the VDMX table has been defined.

这看起来就像在Firefox中发生的:在最小和最大高度不正确的地方计算。当您选择文本时,这也是清楚的:选择框延伸到行的最顶部和底部;如果 h1 元素真的有填充,您会看到行的顶部和底部与选择框之间的差距。

This looks exactly like what happens in Firefox: somewhere the minimum and maximum height is incorrectly calculated. This is also clear when you select the text: the selection box extends to the utmost top and bottom of the line; if the h1 element really had padding, you would see a gap between the top and bottom of the line and the selection box.

此外,验证显示几乎每个字形都是极点缺失点

Also, validation revealed that almost every glyph is "missing points at extrema":


PostScript和TrueType都将
像你一样在最大值
和最小值路径

Both PostScript and TrueType would like you to have points at the maxima and minima (the extrema) of a path.

快速 search 显示:


我唯一遇到的另一个问题是
令人讨厌的条件称为缺少
点在Extrema。使用字体
,需要在
的一个点(或节点,如
他们被调用)在
的一个字形的极端左边,右边,顶部和底部。通常他们有
无论如何简单地是因为你的
字形的建立方式,但对角线
圆角末端常常会导致问题
[来源,包括图片(向下卷动)]

这篇关于@ font-face问题,Firefox添加了padding,Chrome没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆