【发布时间】:2015-06-17 03:24:59
【问题描述】:
我想在我的网站上为我的徽标添加两种字体,Bebas Neue Regular 和 Bebas Neue Thin。
我使用 font-squirrels 在线字体转换工具转换了我的字体,并在我的 css 中添加了相关的@font-face 代码:
@font-face {
font-family: BebasNeueReg;
src: url("/fonts/BebasNeueRegular.eot");
src: url("/fonts/BebasNeueRegular.eot?#iefix") format('embedded-opentype'),
url("/fonts/BebasNeueRegular.woff2") format('woff2'),
url("/fonts/BebasNeueRegular.woff") format('woff'),
url("/fonts/BebasNeueRegular.ttf") format('truetype'),
url("/fonts/BebasNeueRegular.svg") format('svg');
}
如您所见,这是 Bebas Neue Regular 的 @font-face css。出于某种奇怪的原因,Bebas Neue Thin 的 css @font-face 在所有浏览器中都运行良好。这个 css 除了 src 不同之外,完全一样。
@font-face {
font-family: BebasNeueThin;
src: url("/fonts/BebasNeueThin.eot");
src: url("/fonts/BebasNeueThin.eot?#iefix") format('embedded-opentype'),
url("/fonts/BebasNeueThin.woff2") format('woff2'),
url("/fonts/BebasNeueThin.woff") format('woff'),
url("/fonts/BebasNeueThin.ttf") format('truetype'),
url("/fonts/BebasNeueThin.svg") format('svg');
}
我尝试了多种方法,例如使用不同的字体转换工具转换字体,交换 url 的顺序。
谁能解释一下?以前有人遇到过同样的问题吗?
提前致谢。
【问题讨论】:
-
你可以试试其他字体比如arial吗?某些浏览器不会打开错误的字体类型
-
其他字体工作正常,例如,我使用的是 open sans google api 字体,效果很好。
-
尝试使用fontsquirrel下载另一个包,看看你的问题是否仍然存在,如果是,这个包包含错误
-
会做的,谢谢你的建议。