在 Firefox 中使用 Materialise 的 Roboto 字体显示问题
Display Issues with Roboto Font from Materialize in Firefox
我正在使用 Materialize to style some of my web pages. I have noticed that Roboto font does not render correctly in Firefox (v43.0.3), but looks fine in Chrome. Both browsers are downloading the woff2 font file from my server, which this question 似乎表明应该是现代浏览器的最佳选择。
Chrome效果图:
Firefox 渲染:
(我意识到这些低分辨率的屏幕截图并不是最好的再现,在实际浏览器中差异更加明显。)
在 Firefox 控制台中,我收到一串类似于以下内容的错误消息:
downloadable font: GSUB: too large substitute: 65535 (font-family: "Roboto" style:normal weight:normal stretch:normal src index:1)
downloadable font: Layout: Failed to parse lookup subtable 0 (font-family: "Roboto" style:normal weight:normal stretch:normal src index:1)
downloadable font: Layout: Failed to parse lookup subtable 0 (font-family: "Roboto" style:normal weight:normal stretch:normal src index:1)
没有来自 Chrome 的投诉。
由于我完全不熟悉字体渲染的复杂性,我希望对该领域有一定了解的人可以根据 Firefox 的错误消息了解问题所在。
在我看来,要么是 woff2 文件对内部字体 tables 的偏移量有误,要么是 Firefox 在解析偏移量时读取了错误的偏移量。
错误信息中提到的GSUB
table不可能是渲染问题的主要原因,因为它只定义了字形替换(如连字组合和分解,相同字符的替代字形代码等)。 table 不包含任何标准字形的渲染信息,因此如果只是 table 加载失败,标准文本的渲染应该不会受到影响。关于 GSUB table 的详细信息可以在 Microsoft's OTF specification.
中找到
此外,我在查看此网站时收到另一条错误消息:
http://gwt-material-demo.herokuapp.com/
Firefox 告诉我 OS/2
table(包含 Windows 字体规格)有问题。这是字体文件中完全不同的部分,这再次表明字体结构或读取字体结构有问题。
所以您可以做两件事:
不要使用 woff2
文件。
将此问题通知 Roboto 和 Firefox 开发人员,希望他们能找到导致此错误的原因并修复它。
我终于有时间仔细研究了一下,似乎 materialize repository are defective. I was able to completely resolve this issue simply by replacing the font files in the dist/font/roboto
directory with the same files available at roboto-fontface-bower 中的一些字体文件。只需从任何版本分支 v0.3.0
或更好。
希望这可以帮助任何因此而感到沮丧的人。
我正在使用 Materialize to style some of my web pages. I have noticed that Roboto font does not render correctly in Firefox (v43.0.3), but looks fine in Chrome. Both browsers are downloading the woff2 font file from my server, which this question 似乎表明应该是现代浏览器的最佳选择。
Chrome效果图:
Firefox 渲染:
(我意识到这些低分辨率的屏幕截图并不是最好的再现,在实际浏览器中差异更加明显。)
在 Firefox 控制台中,我收到一串类似于以下内容的错误消息:
downloadable font: GSUB: too large substitute: 65535 (font-family: "Roboto" style:normal weight:normal stretch:normal src index:1)
downloadable font: Layout: Failed to parse lookup subtable 0 (font-family: "Roboto" style:normal weight:normal stretch:normal src index:1)
downloadable font: Layout: Failed to parse lookup subtable 0 (font-family: "Roboto" style:normal weight:normal stretch:normal src index:1)
没有来自 Chrome 的投诉。
由于我完全不熟悉字体渲染的复杂性,我希望对该领域有一定了解的人可以根据 Firefox 的错误消息了解问题所在。
在我看来,要么是 woff2 文件对内部字体 tables 的偏移量有误,要么是 Firefox 在解析偏移量时读取了错误的偏移量。
错误信息中提到的GSUB
table不可能是渲染问题的主要原因,因为它只定义了字形替换(如连字组合和分解,相同字符的替代字形代码等)。 table 不包含任何标准字形的渲染信息,因此如果只是 table 加载失败,标准文本的渲染应该不会受到影响。关于 GSUB table 的详细信息可以在 Microsoft's OTF specification.
此外,我在查看此网站时收到另一条错误消息: http://gwt-material-demo.herokuapp.com/
Firefox 告诉我 OS/2
table(包含 Windows 字体规格)有问题。这是字体文件中完全不同的部分,这再次表明字体结构或读取字体结构有问题。
所以您可以做两件事:
不要使用
woff2
文件。将此问题通知 Roboto 和 Firefox 开发人员,希望他们能找到导致此错误的原因并修复它。
我终于有时间仔细研究了一下,似乎 materialize repository are defective. I was able to completely resolve this issue simply by replacing the font files in the dist/font/roboto
directory with the same files available at roboto-fontface-bower 中的一些字体文件。只需从任何版本分支 v0.3.0
或更好。
希望这可以帮助任何因此而感到沮丧的人。