资产管道,指南针字体和eot?iefix调用字体 [英] Asset pipeline, compass font-face and eot?iefix call to the font

查看:109
本文介绍了资产管道,指南针字体和eot?iefix调用字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Compass字体混合,其中包含
* .eot?iefix

I am trying to use a Compass font-face mixin, which contains the inclusion of
*.eot?iefix

我的应用程序/资产/字体包含所有需要的字体类型,包括.eot.

My app/assets/fonts contains all the font types needed, including .eot.

当我尝试运行Assets:precompile时,任务失败,提示如下: webfont.eot?iefix未预编译

When I try to run assets:precompile the task fails saying something like: webfont.eot?iefix isn't precompiled

您知道该问题的可能解决方案吗?

Do you know the possible solution for this problem?

如果我有config.assets.compile = true,它可以正常运行,但是据我所知,最好不要在生产环境中使用它.

It runs with no error in case I have config.assets.compile = true, but as I've understood it's better not to use it on production.

推荐答案

您也可以使用纯 Scss 来做到这一点:

You can do it with pure Scss too:

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

这篇关于资产管道,指南针字体和eot?iefix调用字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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