FontFace: ascentOverride プロパティ
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
ascentOverride は FontFace インターフェイスのプロパティで、フォントの ascent メトリック、つまり CSS がインライン整形コンテキストで行ボックスをレイアウトするために使用するベースラインからの高さを返したり設定したりします。
このプロパティは @font-face の ascent-override 記述子と等価です。
値
文字列です。使用可能な値は、使用するメトリクスをフォントファイルから取得することを示す normal か、パーセント値です。
このプロパティは ascent-override 記述子と同じ値を受け入れます。
例
js
let fontFace = new FontFace(
"Roboto",
"url(https://fonts.example.com/roboto.woff2)",
{ ascentOverride: "90%" },
);
console.log(fontFace.ascentOverride); // 90%
fontFace.ascentOverride = "normal";
console.log(fontFace.ascentOverride); // 'normal'
仕様書
| Specification |
|---|
| CSS Font Loading Module Level 3> # dom-fontfacedescriptors-ascentoverride> |
ブラウザーの互換性
Loading…