スタイルfontSizeAdjustプロパティ
例
フォントサイズを調整します。
document.getElementById("demo").style.fontSizeAdjust = "0.58";
定義と使用法
fontSizeAdjustプロパティは、テキストのフォントアスペクト値を設定または返します。
すべてのフォントには、小文字の「x」と大文字の「X」のサイズの差であるアスペクト値があります。
fontSizeAdjustプロパティを使用すると、最初に選択したフォントが使用できない場合に、フォントサイズをより適切に制御できます。フォントが使用できない場合、ブラウザは2番目に指定されたフォントを使用します。これにより、フォントサイズが大幅に変更される可能性があります。これを防ぐには、このプロパティを使用します。
ブラウザが最初の選択肢のフォントのアスペクト値を知っている場合、ブラウザは2番目の選択肢のフォントでテキストを表示するときに使用するフォントサイズを把握できます。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
fontSizeAdjust | Not supported | Not supported | Yes | Not supported | Not supported |
構文
fontSizeAdjustプロパティを返します。
object.style.fontSizeAdjust
fontSizeAdjustプロパティを設定します。
object.style.fontSizeAdjust = "none|number|initial|inherit"
Value | Description |
---|---|
none | Default value. No font size adjustment |
number | Preserve the first-choice font's x-height, and calculate the aspect value ratio for the font. The formula that is used: font-size of first-choice font*(aspect value of first-choice font/aspect value of available font)=font-size to use on available font Example: If 14px Verdana (aspect value of 0.58) was unavailable, but the available font, Times New Roman, has an aspect value of 0.46, the adjusted font-size to use would be 14*(0.58/0.46) = 17.65px. |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | なし |
---|---|
戻り値: | テキストのフォントアスペクト値を表す文字列 |
CSSバージョン | CSS3 |
関連ページ
CSSチュートリアル:CSSフォント
CSSリファレンス:font-sizeプロパティ
HTML DOMリファレンス:フォントプロパティ
❮スタイルオブジェクト