我的一种网络字体无法在 Firefox 上呈现
我的网站上安装了两种网络字体,一种可以在 Firefox 上使用,而另一种则不能。如果你在 Chrome 上检查,两种 Google 网络字体都可以完美运行。 这是我的代码:
@font-face {
font-family: 'UnitSlabProLight';
src: url('/unitslabpro-light-webfont.eot');
src: url('/unitslabpro-light-webfont.eot?#iefix') format('embedded-opentype'),
url('/unitslabpro-light-webfont.woff') format('woff'),
url('/unitslabpro-light-webfont.ttf') format('truetype'),
url('/unitslabpro-light-webfont.svg#UnitSlabProLight') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'UnitSlabProBlack';
src: url('/unitslabpro-black-webfont.eot');
src: url('/unitslabpro-black-webfont.eot?#iefix') format('embedded-opentype'),
url('/unitslabpro-black-webfont.woff') format('woff'),
url('/unitslabpro-black-webfont.ttf') format('truetype'),
url('/unitslabpro-black-webfont.svg#UnitSlabProBlack') format('svg');
font-weight: normal;
font-style: normal;
}
网站是 http://www.journeytoearth.com/
提前感谢您的任何帮助和解决方案。
I have two web fonts installed on my site and one is working on Firefox, while the other one is not. If you check it on Chrome, both of the Google web fonts work perfect.
Here is my code:
@font-face {
font-family: 'UnitSlabProLight';
src: url('/unitslabpro-light-webfont.eot');
src: url('/unitslabpro-light-webfont.eot?#iefix') format('embedded-opentype'),
url('/unitslabpro-light-webfont.woff') format('woff'),
url('/unitslabpro-light-webfont.ttf') format('truetype'),
url('/unitslabpro-light-webfont.svg#UnitSlabProLight') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'UnitSlabProBlack';
src: url('/unitslabpro-black-webfont.eot');
src: url('/unitslabpro-black-webfont.eot?#iefix') format('embedded-opentype'),
url('/unitslabpro-black-webfont.woff') format('woff'),
url('/unitslabpro-black-webfont.ttf') format('truetype'),
url('/unitslabpro-black-webfont.svg#UnitSlabProBlack') format('svg');
font-weight: normal;
font-style: normal;
}
Site is http://www.journeytoearth.com/
Thanks in advance for any help and solutions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来“UnitSlabProBlack”的 @font-face src 属性是绝对链接的,而“UnitSlabProLight”src 属性是相对于根的。
我建议尝试更改 UnitSlabProBlack src 格式以匹配“UnitSlabProLight”的格式,因为该格式有效。
看起来 Firefox 只接受 src 的相对链接:
http://webfonts.info/wiki/index.php?title=%40font -face_support_in_Firefox
来自 http://www.journeytoearth.com/wp-content/themes/melville/style.css
It looks like the @font-face src property for the "UnitSlabProBlack" is absolutely linked, while your "UnitSlabProLight" src property is relative to the root.
I would suggest to try changing the UnitSlabProBlack src format to match that of the "UnitSlabProLight", since that one works.
It looks like Firefox only accepts relative links for the src:
http://webfonts.info/wiki/index.php?title=%40font-face_support_in_Firefox
From http://www.journeytoearth.com/wp-content/themes/melville/style.css