調査アンケート: Blockly のご利用体験についてお聞かせください
アンケートを開始
ブロックする >utils >ドメイン >measureFontMetrics
utils.dom.measureFontMetrics() 関数
フォントの指標を測定します。高さとベースラインの値。
署名:
export declare function measureFontMetrics(text: string, fontSize: string, fontWeight: string, fontFamily: string): {
height: number;
baseline: number;
};
パラメータ
パラメータ |
型 |
説明 |
テキスト |
文字列 |
フォントの寸法を測定するテキスト。 |
fontSize |
文字列 |
使用するフォントサイズ。 |
fontWeight |
文字列 |
使用するフォントの太さ。 |
fontFamily |
文字列 |
使用するフォント ファミリー。 |
戻り値:
{ height: number;baseline: number;}
フォントの測定値。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-09-20 UTC。
[null,null,["最終更新日 2024-09-20 UTC。"],[[["`measureFontMetrics` calculates the height and baseline of a given text based on its font size, weight, and family."],["It takes the text, font size, font weight, and font family as input and returns an object containing the height and baseline measurements."],["This function helps determine the dimensions of text elements for accurate positioning and rendering within Blockly applications."]]],[]]