1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

IonicでGoogle Fontを使う方法

Last updated at Posted at 2022-03-25

Google Fontをダウンロード

今回は「Noto Sans Japanese」を例にしていきます。
普通にGoogle Fontのデータをダウンロード

スクリーンショット 2022-03-25 9.12.17.png

おそらく6種類のファイルがダウンロードできたかと思いますが、今回はNotoSansJP-Regular.otfしか使いません:ok_woman:

プロジェクト内に設置

👇のようにIonicのプロジェクト内の設置します。
projectFolder/src/assets/fonts/Noto_Sans_JP/NotoSansJP-Regular.otf

Importして使う

global.scssに👇のようなcssを追加

global.scss
@font-face {
  font-family: 'NotoSansJP';
  src: url('assets/fonts/Noto_Sans_JP/NotoSansJP-Regular.otf');
}

ion-content {
  font-family: 'NotoSansJP';
}

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?