LoginSignup
10
4

More than 5 years have passed since last update.

canvasで複数のfont-familyを指定するとき

Posted at

前置き

canvasのfont-familyの複数指定が一瞬わからなくなったので、自分用メモ程度に置いておきます。

説明

canvasでfontの指定をするときは以下のような指定をします。

context.font = '600 10px sans-serif';

font-familyを複数指定しようと思ったのですが、、ふと、どう書けばいいんだろうと手が止まりました。
以下が正解のようです。


context.font = '600 10px "游ゴシック体", "Hiragino Kaku Gothic ProN",sans-serif ';  

普通にcssのfont-familyの書き方まんまですが、一応共有しておきます。

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