Meteor:无法解码下载的字体和OTS解析错误-版本标记无效

Meteor:无法解码下载的字体和OTS解析错误-版本标记无效,meteor,twitter-bootstrap-3,fonts,glyphicons,Meteor,Twitter Bootstrap 3,Fonts,Glyphicons,我已经开始在我的meteor项目中使用glyphicons和twbs:boostrap包。自从我开始使用它们以来,我在控制台中一直收到以下警告: Failed to decode downloaded font: http://localhost:3000/fonts/glyphicons-halflings-regular.woff2 OTS parsing error: invalid version tag Failed to decode downloaded font: http://

我已经开始在我的meteor项目中使用glyphicons和twbs:boostrap包。自从我开始使用它们以来,我在控制台中一直收到以下警告:

Failed to decode downloaded font: http://localhost:3000/fonts/glyphicons-halflings-regular.woff2
OTS parsing error: invalid version tag
Failed to decode downloaded font: http://localhost:3000/fonts/glyphicons-halflings-regular.woff
OTS parsing error: invalid version tag
Failed to decode downloaded font: http://localhost:3000/fonts/glyphicons-halflings-regular.ttf
OTS parsing error: invalid version tag

是什么原因导致了这种情况?我如何抑制这些警告或解决问题?glyphicons工作得非常好,但是一直看到警告是一件痛苦的事情。

这意味着您用于导入glyphicons的包中有一个错误,没有正确声明字体文件的位置,或者没有将字体文件正确添加到包本身


检查软件包维护人员发布的跟踪器,同时将glyphicons下载到您的
public
目录中,并在您自己的CSS文件中声明它们。

在尝试了许多其他方法,以及大量重新安装和检查meteor plus npm配置之后,我刚刚解决了这个问题,清除了Chrome浏览器中的浏览数据(缓存的图像和文件),然后刷新页面。

Serkan Durusoy上面的回答对我来说很有效,但这里有一些关于我必须做什么的详细信息

  • 将字体文件从node_modules/bootstrap/dist/font复制到public/font

  • 将此添加到my main.css:

    @字体{ 字体系列:“字形图标半身人”; src:url('font/glyphions-halflings-regular.eot'); src:url('font/glyphions halflings regular.eot?#iefix')格式('embedded-opentype')、url('font/glyphions halflings regular.woff2')、url('font/glyphions halflings regular.woff')、url('font/glyphions halflings regular.ttf')格式('truetype')、url('fonts/glyphicons halflings regular.svg#glyphicons_halflings regular')格式('svg'); }


  • 我从node_modules/bootstrap/dist/css/bootstrap.css复制了css,并更改了路径以匹配我放置字体的位置。

    如何在css文件中声明它们,以及从何处下载glyphicons?只需将它们从引导/字体文件夹复制粘贴到公共/字体文件夹中即可