css - 无法在 Meteor 中解码下载的字体

标签 css meteor fonts

这是我的 CSS:

@font-face {
    font-family: 'geometria_lightlight';
    src: url('Geometria-Light-webfont.eot');
    src: url('Geometria-Light-webfont.eot?#iefix') format('embedded-opentype'),
         url('Geometria-Light-webfont.woff2') format('woff2'),
         url('Geometria-Light-webfont.woff') format('woff'),
         url('Geometria-Light-webfont.ttf') format('truetype'),
         url('Geometria-Light-webfont.svg#geometria_lightlight') format('svg');
    font-weight: lighter;
    font-style: normal;

}

#logo{
  font-family: 'geometria_lightlight';
  font-size: 60px;
}

这是我在 Chrome 中收到的消息: 无法解码下载的字体:http://localhost:3000/Geometria-Light-webfont.woff2 localhost/:1 OTS 解析错误:版本标签无效 localhost/:1 无法解码下载的字体:http://localhost:3000/Geometria-Light-webfont.woff

我通过 Font Squirrel 下载的每一种字体都会收到此消息。

最佳答案

将您的字体放在文件夹 public/fonts 中。

然后做这样的事情:

@font-face {
  font-family: 'BebasNeueRegular';
  src: url('/fonts/BebasNeue-Regular.ttf') format('truetype');
}

关于css - 无法在 Meteor 中解码下载的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32767727/

相关文章:

css - 如何只选择第一个和最后一个<th>?

javascript - 在 Angular 4 中使用 select 更改(输入的)字体系列?

javascript - 如何在每个 & 周围插入跨度

css - 字体样式不适用于智能手机?

javascript - 嵌入其他网页的网页

HTML5/CSS3 : Hover Image Replacement

html - 无法正确居中,边距 : 0 auto/margin:auto isn't working

ios - 在 iPhone 6 上的 Meteor Cordova 应用程序中进行缩放

meteor - 更新Meteor.users

javascript - 你如何使用 meteor-accounts-t9n 包?