Ionic framework 爱奥尼亚的字体变化

Ionic framework 爱奥尼亚的字体变化,ionic-framework,fonts,Ionic Framework,Fonts,我想在我的应用程序中使用“Comfortaa”字体,所有类似页面的默认字体。我使用的字体使用url。 像这样: <style> @import url('https://fonts.googleapis.com/css?family=Comfortaa'); </style> 但应用程序处于脱机状态。字体在我的应用程序中不起作用。如何在脱机和联机状态下使用字体。 当应用程序处于脱机状态时,它会显示斜体字体。 像这样首先下载并将文件夹放在src/assets/font

我想在我的应用程序中使用“Comfortaa”字体,所有类似页面的默认字体。我使用的字体使用url。 像这样:

<style>
  @import url('https://fonts.googleapis.com/css?family=Comfortaa');
</style>
但应用程序处于脱机状态。字体在我的应用程序中不起作用。如何在脱机和联机状态下使用字体。 当应用程序处于脱机状态时,它会显示斜体字体。
像这样

首先下载并将文件夹放在src/assets/font中,然后在主题文件夹中写入:

 $font-path: "../assets/fonts";
 @font-face {
 font-family: GlobalFont;
 src: url("../assets/fonts/Comfortaa/Comfortaa.ttf");
 }

 body, span, button, h1, h2, h3, h4, h5, h6, p, ion-item, ion-title {
字体系列:“GlobalFont”!重要的 }

将自定义字体添加到资源/字体文件夹

将以下代码添加到app.scss文件

@font-face {
  font-family: 'San Francisco Light';
  font-weight: normal;
  font-style: normal;
  src: url('../assets/fonts/SanFranciscoDisplay-Regular.otf');
}

After In theme/variables.scss file

add variable name
like this:`enter code here`
$font-family-ios-base: "San Francisco Light";
$font-family-md-base:  "roboto";
For add custom font in a application 
Do following step:
@font-face {
  font-family: 'San Francisco Light';
  font-weight: normal;
  font-style: normal;
  src: url('../assets/fonts/SanFranciscoDisplay-Regular.otf');
}

After In theme/variables.scss file

add variable name
like this:`enter code here`
$font-family-ios-base: "San Francisco Light";
$font-family-md-base:  "roboto";