自定义字体未在离子框架中加载

Muh*_*han 7 font-face ionic-framework

我想在我的Ionic项目中应用Open Sans字体.我在我的自定义scss文件(settings.sccs和其他scss文件)所在的SCSS文件夹中使用了此代码(demoProject\scss_setting.scss)

@font-face {
  font-family: 'Open Sans';
  src: url('../www/fonts/opensans-regular-webfont.eot');
  src: url('../www/fonts/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
  url('../www/fonts/opensans-regular-webfont.woff') format('woff'),
  url('../www/fonts/opensans-regular-webfont.ttf') format('truetype'),
  url('../www/fonts/opensans-regular-webfont.svg') format('svg');
  font-weight: 200;
}
body{
 font-family: 'Open Sans';
}
Run Code Online (Sandbox Code Playgroud)

字体位于此处(demoProject\www\fonts)

并尝试应用于整个身体,但浏览器的控制台正在显示

 GET http://localhost:8100/www/fonts/opensans-regular-webfont.woff 
:8100/www/fonts/opensans-regular-webfont.ttf:1
GET http://localhost:8100/www/fonts/opensans-regular-webfont.ttf 
Run Code Online (Sandbox Code Playgroud)

Nic*_*boy 17

我相信你在目录链中走得太远了.

我想你想要更像这样的东西:

@font-face {
    font-family: 'Open Sans';
    src: url('../fonts/opensans-regular-webfont.eot');
    src: url('../fonts/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
    url('../fonts/opensans-regular-webfont.woff') format('woff'),
    url('../fonts/opensans-regular-webfont.ttf') format('truetype'),
    url('../fonts/opensans-regular-webfont.svg') format('svg');
    font-weight: 200;
}
body{
    font-family: 'Open Sans';
}
Run Code Online (Sandbox Code Playgroud)

这是一个将Font Awesome添加到项目中的教程,这是一个自定义字体:

http://blog.nraboy.com/2014/10/use-font-awesome-glyph-icons-ionicframework/

如果有帮助,请告诉我.

问候,