FontFace: family プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
FontFace.family
プロパティにより、 FontFace
オブジェクトのフォントファミリを取得したり設定したりすることができます。
この値は、 font-family
プロパティを使用して要素をスタイル設定するときに、特定のフォントフェイスに対して名前を照合するために用いられます。
任意の名前を使用することができ、これは基盤のフォントデータで指定した名前を上書きします。
このプロパティは @font-face
の font-family
記述子と等価です。
値
文字列です。
例
js
let fontFace = new FontFace(
"Roboto",
"url(https://fonts.example.com/roboto.woff2)",
);
console.log(fontFace.family); // 'Roboto'
fontFace.family = "newRoboto";
console.log(fontFace.family); // 'newRoboto'
仕様書
Specification |
---|
CSS Font Loading Module Level 3 # dom-fontface-family |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
family |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.