无法解码下载的字体,OTS解析错误:无效的版本标签+ rails 4 [英] Failed to decode downloaded font, OTS parsing error: invalid version tag + rails 4

查看:1784
本文介绍了无法解码下载的字体,OTS解析错误:无效的版本标签+ rails 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做资产预编译,并在生产模式下运行应用程序。编译后,当我加载我的索引页面我得到以下警告在chrome控制台:

I am doing assets pre-compile, and running the application in production mode. After compilation when I load the my index page I got followings warnings in the chrome console:

Failed to decode downloaded font: http://localhost:3000/fonts/ionicons.ttf?v=2.0.0
prospects:1 OTS parsing error: invalid version tag
Failed to decode downloaded font: http://localhost:3000/fonts/ionicons.woff?v=2.0.0
prospects:1 OTS parsing error: invalid version tag

我们使用自定义字体,代码如下:

/ p>

we used the custom fonts and the code is:

@font-face {
  font-family: 'icomoon';
  src: font-url('icomoon.eot');
  src: font-url('icomoon.eot?#iefix') format('embedded-opentype'),
       font-url('icomoon.ttf') format('truetype'),
       font-url('icomoon.woff') format('woff'),
       font-url('icomoon.svg#icomoon') format('svg');
  font-weight: normal;
  font-style: normal;
}

我不知道我的结论是什么。我搜索了很多,也尝试了解决方案,但没有得到任何成功。在开发模式下它的工作很好,但不知道为什么它在生产模式下显示方格。

I don't know what is missing from my end . I searched a lot and also tried solution but not got any success.In development mode its working fine but don't know why its showing square in the production mode.

推荐答案

我得到了完全相同的错误,在我的情况下,原来是因为一个错误的路径为 @ font-face 。 Web检查器从来没有投诉404,因为我们使用的开发服务器(live-server)被配置为在任何404:上提供默认的index.html。如果不知道您的设置的任何细节,这可能是一个可能的罪魁祸首。

I got the exact same error, and in my case it turned out to be because of a wrong path for the @font-face declaration. The web inspector never complained with a 404 since the dev server we're using (live-server) was configured to serve up the default index.html on any 404:s. Without knowing any details about your setup, this could be a likely culprit.

这篇关于无法解码下载的字体,OTS解析错误:无效的版本标签+ rails 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆