LoginSignup
4
1

More than 3 years have passed since last update.

Google Noto Fonts (日本語)の組み込み

Posted at

Google Noto Fonts

https://www.google.com/get/noto/
Googleが作ったNotoという名前のフォント

"no more tofu"が合言葉のようで、文字化けや豆腐(フォントにない文字)で苦しむ日本のエンジニアにはうれしい限りです。
(詳しくは、Wikipedia をどうぞ)

Webフォントとして使えるので、組み込み方を整理

手っ取り早く組み込む

@import url(//fonts.googleapis.com/earlyaccess/notosansjapanese.css); 

軽量して組み込む

フォントのロードが終わるまで、デフォルトのフォントで画面が表示されてしまうので、できるだけ早くロードするTips

@font-face {
    font-family: 'Noto Sans Japanese';
    font-style: normal;
    font-weight: 400;
    src: local('NotoSansJP-Regular.otf'),
         url(//fonts.gstatic.com/ea/notosansjapanese/v6/NotoSansJP-Regular.woff2) format('woff2'),
         url(//fonts.gstatic.com/ea/notosansjapanese/v6/NotoSansJP-Regular.woff) format('woff'),
         url(//fonts.gstatic.com/ea/notosansjapanese/v6/NotoSansJP-Regular.otf) format('opentype');
    font-display: swap;
}

References

4
1
1

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
4
1