基于“发现流星"显微镜应用程序的流星字体问题 [英] trouble with font-face in meteor based on Discover Meteor microscope app

查看:91
本文介绍了基于“发现流星"显微镜应用程序的流星字体问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我阅读了《发现流星》一书并成功创建了显微镜.现在,我正在尝试根据所学知识来构建自己的应用程序.我想对字体和图标字体使用@ font-face.我无法让他们露面.

I've gone through the Discover Meteor book and successfully created Microscope. Now I'm trying to build my own app based on what I've learned. I want to use @font-face for fonts and icon fonts. I can't get them to show up.

这是我的目录结构:客户端/样式表

Here's my directory structure: client/stylesheets

我的字体在样式表文件夹中.顺便说一下,我正在使用scss,并且与scss包一起正常工作.这是我在样式表中调用字体的方式:

I've got my fonts in the stylesheets folder. I'm using scss, by the way, and that's working fine with the scss package. Here's how I'm calling the fonts in the stylesheet:

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

我已经尝试过'/stylesheets/Amaranth等,以及我能想到的所有其他组合,但没有任何效果.我尝试过将它们公开.没事.

I've tried '/stylesheets/Amaranth etc. and all other combinations that I can think of and nothing is working. I've tried putting them in public. Nothing.

我知道像这样的文件应该放在公用文件夹中,但这似乎完全杀死了样式表.我不确定为什么显微镜目录设计会导致这种情况发生.

I know files like this are supposed to go in public folder but that seems to kill the stylesheets entirely. I'm not sure why the Microscope directory design would cause that to happen.

这些问题/答案没有帮助: 在流星中使用字体吗? fontello中的图标字体无法与Meteor js一起使用

These question/answers didn't help: using font-face in meteor? Icon font from fontello not working with Meteor js

感谢您的帮助.

推荐答案

将字体放入/public

这里放置的任何内容都不会被流星翻译成其他任何东西. /public是您网站的根目录,因此,如果您需要引用/public中的任何内容,则无需执行/public/whatever/blah只是/whatever/blah.

Anything put here won't be translated by meteor into anything else. /public is the root of your site, so if you need to reference anything in /public then you don't need to do /public/whatever/blah its just /whatever/blah.

/public也位于应用程序的根目录中,而不是在/client/server下,但与/client/server一起位于根目录级别.

Also /public lives in the root of your app, not under /client or /server but at the root level along with /client and /server.

这篇关于基于“发现流星"显微镜应用程序的流星字体问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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