FontFamily.GetCellDescent メソッド
指定したスタイルの FontFamily オブジェクトのセル ディセントをデザイン単位で返します。フォント メトリックについては、「Obtaining Font Metrics」を参照してください。
Public Function GetCellDescent( _
ByVal style As FontStyle _) As Integer
[C#]
public int GetCellDescent(FontStylestyle);
[C++]
public: int GetCellDescent(FontStylestyle);
[JScript]
public function GetCellDescent(
style : FontStyle) : int;
パラメータ
- style
フォントのスタイル情報が格納されている FontStyle 列挙体。
戻り値
指定した FontStyle 列挙体を使用するこの FontFamily オブジェクトのセル ディセント データ。
使用例
[Visual Basic, C#] 次の例は、Windows フォームでの使用を意図してデザインされており、 Paint イベント ハンドラのパラメータである PaintEventArgs e が必要です。このコードは次のアクションを実行します。
- FontFamily オブジェクトを作成します。
- そのフォント ファミリのセル ディセントを取得します。
- セル ディセントの値をテキストで画面に描画します。
Public Sub GetCellDescent_Example(e As PaintEventArgs)
' Create a FontFamily object.
Dim descentFontFamily As New FontFamily("arial")
' Get the cell descent of the font family in design units.
Dim cellDescent As Integer = _
descentFontFamily.GetCellDescent(FontStyle.Regular)
' Draw the result as a string to the screen.
e.Graphics.DrawString("descentFontFamily.GetCellDescent() returns " _
& cellDescent.ToString() & ".", New Font(descentFontFamily, 16), _
Brushes.Black, New PointF(0, 0))
End Sub
[C#]
public void GetCellDescent_Example(PaintEventArgs e)
{
// Create a FontFamily object.
FontFamily descentFontFamily = new FontFamily("arial");
// Get the cell descent of the font family in design units.
int cellDescent = descentFontFamily.GetCellDescent(FontStyle.Regular);
// Draw the result as a string to the screen.
e.Graphics.DrawString(
"descentFontFamily.GetCellDescent() returns " + cellDescent.ToString() + ".",
new Font(descentFontFamily, 16),
Brushes.Black,
new PointF(0, 0));
}
[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ