本地@ font-face声明未在任何浏览器中呈现

时间:2016-09-24 19:25:39

标签: html css fonts font-face webfonts

我仍然遇到一个问题,其中@ font-face声明未加载本地安装的webfonts,但外部webfonts(Google)运行正常。

毫无意义的是,我的font-face声明中使用的语法与Google的WebFont声明中使用的语法相同,但似乎不起作用。

下一步当然是验证本地字体文件的路径是否正确。复制和粘贴@ font-face声明中使用的URL会导致字体文件被下载到我的计算机,因此路径必须有效。

我还检查了字体文件的权限。这些都被设置为0755,我相信它应该足以供任何浏览器阅读。

一些背景资料;这是一个运行Ubuntu 14.04和后端nginx的Web服务器。

CSS

@font-face {
   font-family: 'BebasNeueRegular';
   font-style: normal;
   font-weight: normal;
   src: url(http://gprejects.com/forum/styles/BBOOTS/theme/font/bebasneue/BebasNeue-webfont.eot?#iefix) format('embedded-opentype'), url(http://gprejects.com/forum/styles/BBOOTS/theme/font/bebasneue/BebasNeue-webfont.woff) format('woff'), url(http://gprejects.com/forum/styles/BBOOTS/theme/font/bebasneue/BebasNeue-webfont.ttf) format('truetype'), url(http://gprejects.com/forum/styles/BBOOTS/theme/font/bebasneue/BebasNeue-webfont.svg#BebasNeueRegular) format('svg');
}

h1, h2, h3, h4, h6, h1 a, h2 a, h3 a, h4 a, h6 a {
    color: #333333;
    font-family: 'BebasNeueRegular','Oswald','Arial','Helvetica',sans-serif;
    font-weight: 200;
    line-height: normal;
    margin: 0 0 10px;
    -webkit-font-smoothing: antialiased;
}

请注意,Oswald是Google WebFont,并且作为后备工作正常,并且与@ font-face声明相同的CSS文件中的所有其他内容也按预期工作。

1 个答案:

答案 0 :(得分:0)

在Chrome检查器中,我没有看到任何调用来获取任何BebasNeue字体文件。您确定BebasNeue的字体系列定义是否正在该页面上加载

相关问题