来自fontello的图标字体不能使用Meteor js [英] Icon font from fontello not working with Meteor js

查看:777
本文介绍了来自fontello的图标字体不能使用Meteor js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已从fontello下载了自定义图标字体,并打算在我的meteor应用程序中使用它。
我试了下载的包和字体显示精致的演示。这是我的css:

I have downloaded a custom icon font from fontello and intend to use it in my meteor app. I tried the demo that comes with the downloaded package and the fonts display fine. Here is my css:

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

[class^="icon-"]:before, [class*=" icon-"]:before {
 font-family: "fontello";
 font-style: normal;
 font-weight: normal;
 speak: none;
 display: inline-block;
 text-decoration: inherit;
 width: 1em;
 margin-right: .2em;
 text-align: center;

 /* For safety - reset parent styles, that can break glyph codes*/
 font-variant: normal;
 text-transform: none;

 /* fix buttons height, for twitter bootstrap */
 line-height: 1em;

}

.icon-twitter:before { content: '\e805'; } /* '' */
.icon-github-circled:before { content: '\e804'; } /* '' */
.icon-pencil:before { content: '\e801'; } /* '' */
.icon-cancel:before { content: '\e802'; } /* '' */
.icon-chat:before { content: '\e800'; } /* '' */

我的文件夹结构如下 client / css / styles.css 和字体 / client / css / fonts /

My folder structure is like so /client/css/styles.css and for the fonts /client/css/fonts/

在我的html中,我已经添加了这个标记< i class =icon-twitter>< / i> 页面这是我看到的
任何帮助将是巨大的。感谢

In my html I have added this markup <i class="icon-twitter"></i> and unfortunately all i see when I view the page this is all I see Any help would be great. Thanks

推荐答案

如果您要在 your.domain.com/fonts/font_name上引用您的字体。 x ,您应该将字体目录移动到标签为 public 的目录。然后您可以使用路径 /fonts/font_name.x 访问它们。

If you want to reference your fonts at your.domain.com/fonts/font_name.x, you should move your fonts directory to a directory labeled public. You can then access them using the path /fonts/font_name.x.

查看非官方流星常见问题解答位于此处: https://github.com/oortcloud/unofficial- meteor-faq#where-should-i-put-my-files

Take a look at the Unofficial Meteor FAQ found here: https://github.com/oortcloud/unofficial-meteor-faq#where-should-i-put-my-files


public /#&例如图片。

public/ # <- static files, such as images, that are served directly.

或Meteor文档直接: http://docs.meteor.com/#structuringyourapp

Or the Meteor documentation directly: http://docs.meteor.com/#structuringyourapp


最后,Meteor服务器将提供public
目录下的任何文件,就像在Rails或Django项目中一样。这是图片,favicon.ico,robots.txt和其他任何内容的地方

Lastly, the Meteor server will serve any files under the public directory, just like in a Rails or Django project. This is the place for images, favicon.ico, robots.txt, and anything else.

这篇关于来自fontello的图标字体不能使用Meteor js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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