@font-face eot 的资产管道问题?iefix

发布于 2024-12-16 11:01:30 字数 974 浏览 4 评论 0原文

我正在开发一个 Rails 应用程序,尝试使用 Rails 3.1 和资产管道配置字体。

我刚刚看了这篇文章

资产管道、compass font-face 和 eot?iefix 对字体的调用

并使用该示例,我从 sass 得到了语法问题。

我的代码如下:

/* @font-face kit by Fonts2u (http://www.fonts2u.com) */ 
@font-face {
  font-family: 'Coamei Bold';
  src: font_url('fonts/COAMEI_B.eot');
  src: url('<%= asset_path('fonts/COAMEI_B.eot')+"?#iefix" %>') format('embedded-opentype'),
       font_url('fonts/COAMEI_B.woff') format('woff'),
       font_url('fonts/COAMEI_B.ttf') format('truetype'),
       url('<%= asset_path('COAMEI_B.svg')+"#Coamei-Bold" %>') format('svg');
  font-weight:normal;
  font-style:normal;
}

由于某种原因,我收到错误

Sass::SyntaxError: Invalid CSS after "...'fonts/COAMEI_B": Expected ")", was ".eot')+"?#iefix... “

我的 css 文件中是否缺少某些内容。任何帮助将不胜感激。

提前致谢

Im working on a rails app trying to configure fonts with rails 3.1 and the asset pipeline.

I just took a look at this post

Asset pipeline, compass font-face and eot?iefix call to the font

and using the example i get a syntax issue from sass.

My code is as follows:

/* @font-face kit by Fonts2u (http://www.fonts2u.com) */ 
@font-face {
  font-family: 'Coamei Bold';
  src: font_url('fonts/COAMEI_B.eot');
  src: url('<%= asset_path('fonts/COAMEI_B.eot')+"?#iefix" %>') format('embedded-opentype'),
       font_url('fonts/COAMEI_B.woff') format('woff'),
       font_url('fonts/COAMEI_B.ttf') format('truetype'),
       url('<%= asset_path('COAMEI_B.svg')+"#Coamei-Bold" %>') format('svg');
  font-weight:normal;
  font-style:normal;
}

For some reason i get the error

Sass::SyntaxError: Invalid CSS after "...'fonts/COAMEI_B": expected ")", was ".eot')+"?#iefix..."

Is there something im missing in my css file. Any help would be greatly appreciated.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文