Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 爱奥尼亚的自定义字体问题_Angular_Ionic Framework_Sass_Ionic2_Ionic3 - Fatal编程技术网

Angular 爱奥尼亚的自定义字体问题

Angular 爱奥尼亚的自定义字体问题,angular,ionic-framework,sass,ionic2,ionic3,Angular,Ionic Framework,Sass,Ionic2,Ionic3,要求:我需要应用自定义字体 简要说明:在app.scss中,我们调用以下字体: @font-face { font-family: 'Roboto'; src: url('../assets/fonts/Roboto/Roboto-Light.ttf') format('ttf'); font-weight: normal; font-style: normal; } * { font-family: 'Roboto'; } // @font-face { //

要求:我需要应用自定义字体

简要说明:
app.scss
中,我们调用以下字体:

@font-face {
  font-family: 'Roboto';
  src: url('../assets/fonts/Roboto/Roboto-Light.ttf') format('ttf');
  font-weight: normal;
  font-style: normal;
}

* {
  font-family: 'Roboto';
}

    // @font-face {
//   font-family: 'Humanst';
//   src: url('../assets/fonts/humanst-webfont.woff2') format('woff2'), url('../assets/fonts/humanst-webfont.woff') format('woff');
//   font-weight: normal;
//   font-style: normal;
// }

// * {
//   font-family: 'Humanst' !important;
// }
当我们使用
ionic-service
时,此字体不适用,如果我们注释Roboto字体代码并取消注释Humanst,菜单图标、后退图标和所有其他图标也会消失[见左上角和右上角],如下图所示

为什么会这样


转到
变量.scss
&在文件末尾添加以下代码:

@font-face {
   font-family: 'Humanst';
   src: url('../assets/fonts/humanst-webfont.woff2') format('woff2'), url('../assets/fonts/humanst-webfont.woff') format('woff');
   font-weight: normal;
   font-style: normal;
 }

$font-family-base: 'Humanst';
$font-family-ios-base: 'Humanst';
$font-family-md-base: 'Humanst';
$font-family-wp-base: 'Humanst';
!重要信息
只能作为最后手段使用,否则将覆盖所有内容

您可以执行与使用字体awsome相同的过程