Fontとは? わかりやすく解説

Font イベント


パブリック イベントパブリック イベント

参照参照

関連項目

Font クラス
Microsoft.WindowsMobile.DirectX.Direct3D 名前空間

その他の技術情報

Mobile Direct3D プログラミング

Font クラス

特定のデバイス特定のフォントレンダリングするために必要なテクスチャリソースカプセル化ます。

名前空間: Microsoft.WindowsMobile.DirectX.Direct3D
アセンブリ: Microsoft.WindowsMobile.DirectX (microsoft.windowsmobile.directx.dll 内)
構文構文

継承階層継承階層
System.Object
   Microsoft.WindowsMobile.DirectX.Direct3D.BaseMesh
    Microsoft.WindowsMobile.DirectX.Direct3D.Font
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font クラス

フォント フェイスサイズスタイルの各属性など、テキスト特定の書式定義します。このクラス継承できません。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class
 Font
    Inherits MarshalByRefObject
    Implements ICloneable, ISerializable, IDisposable
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public sealed class Font : MarshalByRefObject,
 ICloneable, ISerializable, IDisposable
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public ref class Font sealed : public
 MarshalByRefObject, ICloneable, ISerializable, IDisposable
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class Font extends MarshalByRefObject
 implements ICloneable, ISerializable, 
    IDisposable
SerializableAttribute 
ComVisibleAttribute(true) 
public final class Font extends
 MarshalByRefObject implements ICloneable, ISerializable, 
    IDisposable
解説解説
継承階層継承階層
System.Object
   System.MarshalByRefObject
    System.Drawing.Font
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (String, Single)

指定したサイズ使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

解説解説
使用例使用例

Font コンストラクタSize、SizeInPoints、および Unit の各プロパティ使用する方法次のコード例示します。この例は、ComboBox1 という名前の ComboBox に "Bigger" と "Smaller" という文字列設定されWindows フォームでの使用意図してデザインされています。そして、次のコードをそのフォーム貼り付けComboBox1_SelectedIndexChanged メソッドに、ComboBox コントロールの SelectedIndexChanged イベント関連付けます。

Private Sub ComboBox1_SelectedIndexChanged(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 ComboBox1.SelectedIndexChanged

    ' Cast the sender object back to a ComboBox.
    Dim ComboBox1 As ComboBox = CType(sender,
 ComboBox)

    ' Retrieve the selected item.
    Dim selectedString As String
 = CType(ComboBox1.SelectedItem, String)

    ' Convert it to lowercase.
    selectedString = selectedString.ToLower()

    ' Declare the current size.
    Dim currentSize As Single

    ' Switch on the selected item. 
    Select Case selectedString

        ' If Bigger is selected, get the current size from the 
        ' Size property and increase it. Reset the font to the
        '  new size, using the current unit.
    Case "bigger"
            currentSize = Label1.Font.Size
            currentSize += 2.0F
            Label1.Font = New Font(Label1.Font.Name, currentSize,
 _
                Label1.Font.Style, Label1.Font.Unit)

            ' If Smaller is selected, get the current size, in points
,
            ' and decrease it by 1.  Reset the font with the new size
            ' in points.
        Case "smaller"
            currentSize = Label1.Font.SizeInPoints
            currentSize -= 1
            Label1.Font = New Font(Label1.Font.Name, currentSize,
 _
                Label1.Font.Style)
    End Select
End Sub
private void ComboBox1_SelectedIndexChanged(System.Object
 sender, 
    System.EventArgs e)
{

    // Cast the sender object back to a ComboBox.
    ComboBox ComboBox1 = (ComboBox) sender;

    // Retrieve the selected item.
    string selectedString = (string) ComboBox1.SelectedItem;

    // Convert it to lowercase.
    selectedString = selectedString.ToLower();

    // Declare the current size.
    float currentSize;

    // Switch on the selected item. 
    switch(selectedString)
    {

            // If Bigger is selected, get the current size from the
 
            // Size property and increase it. Reset the font to the
            //  new size, using the current unit.
        case "bigger":
            currentSize = Label1.Font.Size;
            currentSize += 2.0F;
            Label1.Font = new Font(Label1.Font.Name, currentSize,
 
                Label1.Font.Style, Label1.Font.Unit);

            // If Smaller is selected, get the current size, in points
,
            // and decrease it by 1.  Reset the font with the new size
            // in points.
            break;
        case "smaller":
            currentSize = Label1.Font.SizeInPoints;
            currentSize -= 1;
            Label1.Font = new Font(Label1.Font.Name, currentSize,
 
                Label1.Font.Style);
            break;
    }
}
private:
    void ComboBox1_SelectedIndexChanged(System::Object^ sender
,
        System::EventArgs^ e)
    {

        // Cast the sender object back to a ComboBox.
        ComboBox^ ComboBox1 = (ComboBox^) sender;

        // Retrieve the selected item.
        String^ selectedString = (String^) ComboBox1->SelectedItem;

        // Convert it to lowercase.
        selectedString = selectedString->ToLower();

        // Declare the current size.
        float currentSize;

        // If Bigger is selected, get the current size from the 
        // Size property and increase it. Reset the font to the
        //  new size, using the current unit.
        if (selectedString == "bigger")
        {
            currentSize = Label1->Font->Size;
            currentSize += 2.0F;
            Label1->Font =gcnew System::Drawing::Font(Label1->Font->Name,
 
                currentSize, Label1->Font->Style, Label1->Font->Unit);

        }
        // If Smaller is selected, get the current size, in
        // points, and decrease it by 2.  Reset the font with
        // the new size in points.
        if (selectedString == "smaller")
        {
            currentSize = Label1->Font->Size;
            currentSize -= 2.0F;
            Label1->Font = gcnew System::Drawing::Font(Label1->Font->Name,
 
                currentSize, Label1->Font->Style);

        }
    }
private void comboBox1_SelectedIndexChanged(Object
 sender, 
    System.EventArgs e)
{
    // Cast the sender object back to a ComboBox.
    ComboBox comboBox1 = (ComboBox)sender;
    // Retrieve the selected item.
    String selectedString = (String)comboBox1.get_SelectedItem();
    // Convert it to lowercase.
    selectedString = selectedString.ToLower();
    // Declare the current size.
    float currentSize;
    // Switch on the selected item. 
    // If Bigger is selected, get the current size from the 
    // Size property and increase it. Reset the font to the
    //  new size, using the current unit.
    if (selectedString.Equals("bigger")) {
        currentSize = label1.get_Font().get_Size();
        currentSize += 2;
        label1.set_Font(new Font(label1.get_Font().get_Name(),
 
            currentSize, label1.get_Font().get_Style(), 
            label1.get_Font().get_Unit()));
    }
    else {
        // If Smaller is selected, get the current size, in points,
        // and decrease it by 1.  Reset the font with the new size
        // in points.
        if (selectedString.Equals("smaller")) {
            currentSize = label1.get_Font().get_SizeInPoints();
            currentSize -= 1;
            label1.set_Font(new Font(label1.get_Font().get_Name(),
 
                currentSize, label1.get_Font().get_Style()));
        }
    }
} //comboBox1_SelectedIndexChanged
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (Device, Font)

既存フォントデバイス使用して、Font クラス新しインスタンス初期化します。

名前空間: Microsoft.WindowsMobile.DirectX.Direct3D
アセンブリ: Microsoft.WindowsMobile.DirectX (microsoft.windowsmobile.directx.dll 内)
構文構文

Public Sub New ( _
    device As Device, _
    font As Font _
)
Dim device As Device
Dim font As Font

Dim instance As New Font(device,
 font)
public Font (
    Device device,
    Font font
)
public:
Font (
    Device^ device, 
    Font^ font
)
public Font (
    Device device, 
    Font font
)
public function Font (
    device : Device, 
    font : Font
)

パラメータ

device

フォント オブジェクト関連付ける Device

font

Font。

.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Font クラス
Font メンバ
Microsoft.WindowsMobile.DirectX.Direct3D 名前空間

Font コンストラクタ (Device, FontDescription)

既存デバイスフォント記述使用して、Font クラス新しインスタンス初期化します。

名前空間: Microsoft.WindowsMobile.DirectX.Direct3D
アセンブリ: Microsoft.WindowsMobile.DirectX (microsoft.windowsmobile.directx.dll 内)
構文構文

Public Sub New ( _
    device As Device, _
    description As FontDescription _
)
public Font (
    Device device,
    FontDescription description
)
public:
Font (
    Device^ device, 
    FontDescription description
)
public Font (
    Device device, 
    FontDescription description
)
public function Font (
    device : Device, 
    description : FontDescription
)

パラメータ

device

フォント オブジェクト関連付ける Device

description

FontDescription 構造体

.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Font クラス
Font メンバ
Microsoft.WindowsMobile.DirectX.Direct3D 名前空間

Font コンストラクタ (FontFamily, Single, FontStyle)

指定したサイズスタイル使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    family As FontFamily, _
    emSize As Single, _
    style As FontStyle _
)
Dim family As FontFamily
Dim emSize As Single
Dim style As FontStyle

Dim instance As New Font(family,
 emSize, style)
public Font (
    FontFamily family,
    float emSize,
    FontStyle style
)
public:
Font (
    FontFamily^ family, 
    float emSize, 
    FontStyle style
)
public Font (
    FontFamily family, 
    float emSize, 
    FontStyle style
)
public function Font (
    family : FontFamily, 
    emSize : float, 
    style : FontStyle
)

パラメータ

family

新しい Font の FontFamily。

emSize

新しフォントem サイズ (単位ポイント)。

style

新しフォントの FontStyle。

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

ArgumentNullException

familynull 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

ボタンFont プロパティ新し太字スタイルFont設定する方法次のコード例示します。この例は、Button1 という名前のボタン含んだ Windows フォームでの使用意図してデザインされています。次のコードフォーム貼り付けButton1_Click メソッドボタンClick イベント関連付けます。

 Private Sub Button1_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button1.Click
    If Not Button1.Font.Style = FontStyle.Bold
 Then
        Button1.Font = New Font(FontFamily.GenericSansSerif, _
            12.0F, FontStyle.Bold)
    End If
End Sub
private void Button1_Click(System.Object sender,
 System.EventArgs e)
{
    if (Button1.Font.Style != FontStyle.Bold)
            Button1.Font = new Font(FontFamily.GenericSansSerif
,
            12.0F, FontStyle.Bold);
}
private:
   void Button1_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
   {
      Button1->Font = gcnew System::Drawing::Font( FontFamily::GenericSansSerif,12.0F,FontStyle::Bold
 );
   }
private void button1_Click(Object sender, System.EventArgs
 e)
{
    button1.set_Font(new Font(FontFamily.get_GenericSansSerif(),
 12,
        FontStyle.Bold));
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (FontFamily, Single, GraphicsUnit)

指定したサイズ単位使用して新しFont初期化します。スタイルを FontStyle.Regular に設定します

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    family As FontFamily, _
    emSize As Single, _
    unit As GraphicsUnit _
)
Dim family As FontFamily
Dim emSize As Single
Dim unit As GraphicsUnit

Dim instance As New Font(family,
 emSize, unit)
public Font (
    FontFamily family,
    float emSize,
    GraphicsUnit unit
)
public:
Font (
    FontFamily^ family, 
    float emSize, 
    GraphicsUnit unit
)
public Font (
    FontFamily family, 
    float emSize, 
    GraphicsUnit unit
)
public function Font (
    family : FontFamily, 
    emSize : float, 
    unit : GraphicsUnit
)

パラメータ

family

新しい Font の FontFamily。

emSize

新しフォントem サイズ (単位unit パラメータ指定された値による)。

unit

新しフォントの GraphicsUnit。

例外例外
例外種類条件

ArgumentNullException

familynull 参照 (Visual Basic では Nothing) です。

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (FontFamily, Single, FontStyle, GraphicsUnit)

指定したサイズスタイル、および単位使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    family As FontFamily, _
    emSize As Single, _
    style As FontStyle, _
    unit As GraphicsUnit _
)
Dim family As FontFamily
Dim emSize As Single
Dim style As FontStyle
Dim unit As GraphicsUnit

Dim instance As New Font(family,
 emSize, style, unit)
public Font (
    FontFamily family,
    float emSize,
    FontStyle style,
    GraphicsUnit unit
)
public:
Font (
    FontFamily^ family, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit
)
public Font (
    FontFamily family, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit
)
public function Font (
    family : FontFamily, 
    emSize : float, 
    style : FontStyle, 
    unit : GraphicsUnit
)

パラメータ

family

新しい Font の FontFamily。

emSize

新しフォントem サイズ (単位unit パラメータ指定された値による)。

style

新しフォントの FontStyle。

unit

新しフォントの GraphicsUnit。

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

ArgumentNullException

familynull 参照 (Visual Basic では Nothing) です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (FontFamily, Single, FontStyle, GraphicsUnit, Byte)

指定したサイズスタイル単位、および文字セット使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    family As FontFamily, _
    emSize As Single, _
    style As FontStyle, _
    unit As GraphicsUnit, _
    gdiCharSet As Byte _
)
Dim family As FontFamily
Dim emSize As Single
Dim style As FontStyle
Dim unit As GraphicsUnit
Dim gdiCharSet As Byte

Dim instance As New Font(family,
 emSize, style, unit, gdiCharSet)
public Font (
    FontFamily family,
    float emSize,
    FontStyle style,
    GraphicsUnit unit,
    byte gdiCharSet
)
public:
Font (
    FontFamily^ family, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit, 
    unsigned char gdiCharSet
)
public Font (
    FontFamily family, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit, 
    byte gdiCharSet
)
public function Font (
    family : FontFamily, 
    emSize : float, 
    style : FontStyle, 
    unit : GraphicsUnit, 
    gdiCharSet : byte
)

パラメータ

family

新しい Font の FontFamily。

emSize

新しフォントem サイズ (単位unit パラメータ指定された値による)。

style

新しフォントの FontStyle。

unit

新しフォントの GraphicsUnit。

gdiCharSet

新しフォント使用する GDI 文字セット指定する Byte

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

ArgumentNullException

familynull 参照 (Visual Basic では Nothing) です。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (FontFamily, Single, FontStyle, GraphicsUnit, Byte, Boolean)

指定したサイズスタイル単位、および文字セット使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    family As FontFamily, _
    emSize As Single, _
    style As FontStyle, _
    unit As GraphicsUnit, _
    gdiCharSet As Byte, _
    gdiVerticalFont As Boolean _
)
Dim family As FontFamily
Dim emSize As Single
Dim style As FontStyle
Dim unit As GraphicsUnit
Dim gdiCharSet As Byte
Dim gdiVerticalFont As Boolean

Dim instance As New Font(family,
 emSize, style, unit, gdiCharSet, gdiVerticalFont)
public Font (
    FontFamily family,
    float emSize,
    FontStyle style,
    GraphicsUnit unit,
    byte gdiCharSet,
    bool gdiVerticalFont
)
public:
Font (
    FontFamily^ family, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit, 
    unsigned char gdiCharSet, 
    bool gdiVerticalFont
)
public Font (
    FontFamily family, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit, 
    byte gdiCharSet, 
    boolean gdiVerticalFont
)
public function Font (
    family : FontFamily, 
    emSize : float, 
    style : FontStyle, 
    unit : GraphicsUnit, 
    gdiCharSet : byte, 
    gdiVerticalFont : boolean
)

パラメータ

family

新しい Font の FontFamily。

emSize

新しフォントem サイズ (単位unit パラメータ指定された値による)。

style

新しフォントの FontStyle。

unit

新しフォントの GraphicsUnit。

gdiCharSet

このフォント使用する GDI 文字セット指定する Byte

gdiVerticalFont

新しフォントGDI 縦書きフォントから派生したフォントかどうかを示すブール値。

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

ArgumentNullException

family is null 参照 (Visual Basic では Nothing)

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ

指定した既存の Font と FontStyle を使用する新しFont初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
Font (IntPtr) 指定したポインタ使用して新しFont初期化します。

.NET Compact Framework によってサポートされています。

Font (Font, FontStyle) 指定した既存FontFontStyle 列挙体を使用する新しFont初期化します。
Font (FontFamily, Single) 指定したサイズ使用して新しFont初期化します。
Font (String, Single) 指定したサイズ使用して新しFont初期化します。
Font (FontFamily, Single, FontStyle) 指定したサイズスタイル使用して新しFont初期化します。

.NET Compact Framework によってサポートされています。

Font (FontFamily, Single, GraphicsUnit) 指定したサイズ単位使用して新しFont初期化します。スタイルを FontStyle.Regular に設定します
Font (String, Single, FontStyle) 指定したサイズスタイル使用して新しFont初期化します。

.NET Compact Framework によってサポートされています。

Font (String, Single, GraphicsUnit) 指定したサイズ単位使用して新しFont初期化します。スタイルFontStyle.Regular設定されます。
Font (FontFamily, Single, FontStyle, GraphicsUnit) 指定したサイズスタイル、および単位使用して新しFont初期化します。
Font (String, Single, FontStyle, GraphicsUnit) 指定したサイズスタイル、および単位使用して新しFont初期化します。
Font (FontFamily, Single, FontStyle, GraphicsUnit, Byte) 指定したサイズスタイル単位、および文字セット使用して新しFont初期化します。
Font (String, Single, FontStyle, GraphicsUnit, Byte) 指定したサイズスタイル単位、および文字セット使用して新しFont初期化します。
Font (FontFamily, Single, FontStyle, GraphicsUnit, Byte, Boolean) 指定したサイズスタイル単位、および文字セット使用して新しFont初期化します。
Font (String, Single, FontStyle, GraphicsUnit, Byte, Boolean) 指定したサイズスタイル単位、および文字セット使用して新しFont初期化します。
参照参照

Font コンストラクタ (String, Single, FontStyle)

指定したサイズスタイル使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    familyName As String, _
    emSize As Single, _
    style As FontStyle _
)
Dim familyName As String
Dim emSize As Single
Dim style As FontStyle

Dim instance As New Font(familyName,
 emSize, style)
public Font (
    string familyName,
    float emSize,
    FontStyle style
)
public:
Font (
    String^ familyName, 
    float emSize, 
    FontStyle style
)
public Font (
    String familyName, 
    float emSize, 
    FontStyle style
)
public function Font (
    familyName : String, 
    emSize : float, 
    style : FontStyle
)

パラメータ

familyName

新しい Font に対する FontFamily の文字列形式

emSize

新しフォントem サイズ (単位ポイント)。

style

新しフォントの FontStyle。

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (IntPtr)


Font コンストラクタ (FontFamily, Single)

指定したサイズ使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    family As FontFamily, _
    emSize As Single _
)
Dim family As FontFamily
Dim emSize As Single

Dim instance As New Font(family,
 emSize)
public Font (
    FontFamily family,
    float emSize
)
public:
Font (
    FontFamily^ family, 
    float emSize
)
public Font (
    FontFamily family, 
    float emSize
)
public function Font (
    family : FontFamily, 
    emSize : float
)

パラメータ

family

新しい Font の FontFamily。

emSize

新しフォントem サイズ (単位ポイント)。

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (String, Single, FontStyle, GraphicsUnit, Byte, Boolean)

指定したサイズスタイル単位、および文字セット使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    familyName As String, _
    emSize As Single, _
    style As FontStyle, _
    unit As GraphicsUnit, _
    gdiCharSet As Byte, _
    gdiVerticalFont As Boolean _
)
Dim familyName As String
Dim emSize As Single
Dim style As FontStyle
Dim unit As GraphicsUnit
Dim gdiCharSet As Byte
Dim gdiVerticalFont As Boolean

Dim instance As New Font(familyName,
 emSize, style, unit, gdiCharSet, gdiVerticalFont)
public Font (
    string familyName,
    float emSize,
    FontStyle style,
    GraphicsUnit unit,
    byte gdiCharSet,
    bool gdiVerticalFont
)
public:
Font (
    String^ familyName, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit, 
    unsigned char gdiCharSet, 
    bool gdiVerticalFont
)
public Font (
    String familyName, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit, 
    byte gdiCharSet, 
    boolean gdiVerticalFont
)
public function Font (
    familyName : String, 
    emSize : float, 
    style : FontStyle, 
    unit : GraphicsUnit, 
    gdiCharSet : byte, 
    gdiVerticalFont : boolean
)

パラメータ

familyName

新しい Font に対する FontFamily の文字列形式

emSize

新しフォントem サイズ (単位unit パラメータ指定された値による)。

style

新しフォントの FontStyle。

unit

新しフォントの GraphicsUnit。

gdiCharSet

フォント使用する GDI 文字セット指定する Byte

gdiVerticalFont

新しFontGDI 縦書きフォントから派生したフォントかどうかを示すブール値。

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (Font, FontStyle)

指定した既存FontFontStyle 列挙体を使用する新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    prototype As Font, _
    newStyle As FontStyle _
)
public Font (
    Font prototype,
    FontStyle newStyle
)
public:
Font (
    Font^ prototype, 
    FontStyle newStyle
)
public Font (
    Font prototype, 
    FontStyle newStyle
)
public function Font (
    prototype : Font, 
    newStyle : FontStyle
)

パラメータ

prototype

新しい Font の作成元となる既存Font

newStyle

新しFont適用する FontStyle。FontStyle 列挙体の複数の値を OR 演算子組み合わせることができます

使用例使用例

op_Inequality 演算子Font コンストラクタ、および Bold プロパティ使用するコード例次に示します。この例は、Button2 という名前のボタン含んだ Windows フォームでの使用意図してデザインされています。次のコードフォーム貼り付けButton2_Click メソッドボタンClick イベント関連付けます。

Private Sub Button2_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button2.Click

    If (Color.op_Inequality(Me.BackColor, SystemColors.ControlDark))
 Then
        Me.BackColor = SystemColors.ControlDark
    End If
    If Not (Me.Font.Bold)
 Then
        Me.Font = New Font(Me.Font,
 FontStyle.Bold)
    End If
End Sub
private void Button2_Click(System.Object sender,
 System.EventArgs e)
{

    if (this.BackColor != SystemColors.ControlDark)
    {
        this.BackColor = SystemColors.ControlDark;
    }
    if (!(this.Font.Bold))
    {
        this.Font = new Font(this.Font,
 FontStyle.Bold);
    }
}
void Button2_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
{
   if ( this->BackColor != SystemColors::ControlDark
 )
   {
      this->BackColor = SystemColors::ControlDark;
   }

   if (  !(this->Font->Bold) )
   {
      this->Font = gcnew System::Drawing::Font( this->Font,FontStyle::Bold
 );
   }
}
private void button2_Click(System.Object sender,
 System.EventArgs e)
{
    if (!(this.get_BackColor().Equals(SystemColors.get_ControlDark())))
 {
        this.set_BackColor(SystemColors.get_ControlDark());
    }
    if (!(this.get_Font().get_Bold())) {
        this.set_Font(new Font(this.get_Font(),
 FontStyle.Bold));
    }
} //button2_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (String, Single, FontStyle, GraphicsUnit)

指定したサイズスタイル、および単位使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    familyName As String, _
    emSize As Single, _
    style As FontStyle, _
    unit As GraphicsUnit _
)
Dim familyName As String
Dim emSize As Single
Dim style As FontStyle
Dim unit As GraphicsUnit

Dim instance As New Font(familyName,
 emSize, style, unit)
public Font (
    string familyName,
    float emSize,
    FontStyle style,
    GraphicsUnit unit
)
public:
Font (
    String^ familyName, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit
)
public Font (
    String familyName, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit
)
public function Font (
    familyName : String, 
    emSize : float, 
    style : FontStyle, 
    unit : GraphicsUnit
)

パラメータ

familyName

新しい Font に対する FontFamily の文字列形式

emSize

新しフォントem サイズ (単位unit パラメータ指定された値による)。

style

新しフォントの FontStyle。

unit

新しフォントの GraphicsUnit。

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

解説解説
使用例使用例

Font コンストラクタ使用する方法次のコード例示します。この例は、Windows フォームでの使用意図してデザインされています。この例を実行するには、このコードButton2 という名前のボタン配置されているフォーム貼り付けButton2_Click メソッドボタンClick イベント関連付けます。

Private Sub Button2_Click(ByVal
 sender As System.Object, _
    ByVal e As System.EventArgs) Handles
 Button2.Click

    Button2.Font = New Font(FontFamily.GenericMonospace, 12.0F,
 _
        FontStyle.Italic, GraphicsUnit.Pixel)

End Sub
private void Button2_Click(System.Object sender,
 System.EventArgs e)
{

    Button2.Font = new Font(FontFamily.GenericMonospace, 12.0F,
 
        FontStyle.Italic, GraphicsUnit.Pixel);

}
private:
    void Button2_Click(System::Object^ sender,
        System::EventArgs^ e)
    {
        Button2->Font = gcnew System::Drawing::Font
            (FontFamily::GenericMonospace, 12.0F,
            FontStyle::Italic, GraphicsUnit::Pixel);
    }
private void button2_Click(Object sender, System.EventArgs
 e)
{
    button2.set_Font(new Font(FontFamily.get_GenericMonospace(),
 12, 
        FontStyle.Italic, GraphicsUnit.Pixel));
} //button2_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (String, Single, GraphicsUnit)

指定したサイズ単位使用して新しFont初期化します。スタイルは FontStyle.Regular に設定されます。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    familyName As String, _
    emSize As Single, _
    unit As GraphicsUnit _
)
Dim familyName As String
Dim emSize As Single
Dim unit As GraphicsUnit

Dim instance As New Font(familyName,
 emSize, unit)
public Font (
    string familyName,
    float emSize,
    GraphicsUnit unit
)
public:
Font (
    String^ familyName, 
    float emSize, 
    GraphicsUnit unit
)
public Font (
    String familyName, 
    float emSize, 
    GraphicsUnit unit
)
public function Font (
    familyName : String, 
    emSize : float, 
    unit : GraphicsUnit
)

パラメータ

familyName

新しい Font に対する FontFamily の文字列形式

emSize

新しフォントem サイズ (単位unit パラメータ指定された値による)。

unit

新しフォントの GraphicsUnit。

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ (String, Single, FontStyle, GraphicsUnit, Byte)

指定したサイズスタイル単位、および文字セット使用して新しFont初期化します。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub New ( _
    familyName As String, _
    emSize As Single, _
    style As FontStyle, _
    unit As GraphicsUnit, _
    gdiCharSet As Byte _
)
Dim familyName As String
Dim emSize As Single
Dim style As FontStyle
Dim unit As GraphicsUnit
Dim gdiCharSet As Byte

Dim instance As New Font(familyName,
 emSize, style, unit, gdiCharSet)
public Font (
    string familyName,
    float emSize,
    FontStyle style,
    GraphicsUnit unit,
    byte gdiCharSet
)
public:
Font (
    String^ familyName, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit, 
    unsigned char gdiCharSet
)
public Font (
    String familyName, 
    float emSize, 
    FontStyle style, 
    GraphicsUnit unit, 
    byte gdiCharSet
)
public function Font (
    familyName : String, 
    emSize : float, 
    style : FontStyle, 
    unit : GraphicsUnit, 
    gdiCharSet : byte
)

パラメータ

familyName

新しい Font に対する FontFamily の文字列形式

emSize

新しフォントem サイズ (単位unit パラメータ指定された値による)。

style

新しフォントの FontStyle。

unit

新しフォントの GraphicsUnit。

gdiCharSet

フォント使用する GDI 文字セット指定する Byte

例外例外
例外種類条件

ArgumentException

emSize が、0 以下であるか、無限大となるか、または有効な数値ではありません。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Font コンストラクタ


Font プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

Font クラス
Microsoft.WindowsMobile.DirectX.Direct3D 名前空間

その他の技術情報

Mobile Direct3D プログラミング

Font プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ Bold この Font が太字かどうかを示す値を取得します
パブリック プロパティ FontFamily この Font関連付けられている FontFamily を取得します
パブリック プロパティ GdiCharSet この Font使用する GDI 文字セット指定するバイト値を取得します
パブリック プロパティ GdiVerticalFont この FontGDI 縦書きフォントから派生したフォントかどうかを示すブール値を取得します
パブリック プロパティ Height フォント行間取得します
パブリック プロパティ IsSystemFont フォントが SystemFonts のメンバかどうかを示す値を取得します
パブリック プロパティ Italic この Font斜体かどうかを示す値を取得します
パブリック プロパティ .NET Compact Framework によるサポート .NET Compact Framework によるサポート SizeInPoints この Fontem サイズ (ポイント) を取得します
パブリック プロパティ Strikeout この Fontフォントを通る水平線指定するかどうかを示す値を取得します
パブリック プロパティ .NET Compact Framework によるサポート SystemFontName IsSystemFont プロパティtrue返す場合は、システム フォントの名前を取得します
パブリック プロパティ Underline この Font下線付きかどうかを示す値を取得します
パブリック プロパティ Unit この Font長さの単位取得します
参照参照

関連項目

Font クラス
System.Drawing 名前空間

その他の技術情報

フォントテキスト使用

Font メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Dispose Font クラスによって使用されているすべてのリソース解放します。
パブリック メソッド DrawText オーバーロードされます書式設定されたテキスト描画ます。
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 ( Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 ( Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド MeasureString 指定した Font オブジェクト使用し指定した StringFormat オブジェクト書式指定して描画した場合の、指定した文字列計測します
パブリック メソッド OnLostDevice ビデオ メモリ リソースへのすべての参照解放しすべての状態ブロック削除します
パブリック メソッド OnResetDevice デバイスリセット後に設定を再初期化します。
パブリック メソッド PreloadText 書式設定されたテキストビデオ メモリ読み込みデバイスへのレンダリング効率を向上させます
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

Font クラス
Microsoft.WindowsMobile.DirectX.Direct3D 名前空間

その他の技術情報

Mobile Direct3D プログラミング

Font メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Clone 対象の Font の同一コピー作成します
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信使用するプロキシ生成必要な情報をすべて格納しているオブジェクト作成します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド Dispose この Font によって使用されているすべてのリソース解放します。
パブリック メソッド Equals オーバーロードされますオーバーライドされます指定したオブジェクトがこの Font等しかどうか判断します
パブリック メソッド FromHdc デバイス コンテキスト識別する指定した Windows ハンドルから Font作成します
パブリック メソッド FromHfont 指定した Windows ハンドルから Font作成します
パブリック メソッド FromLogFont オーバーロードされます指定した GDI 論理フォント (LOGFONT) 構造体から Font作成します
パブリック メソッド GetHashCode オーバーライドされますFont処理するためのハッシュ コード取得します
パブリック メソッド GetHeight オーバーロードされます。 このフォント行間返します
パブリック メソッド .NET Compact Framework によるサポート GetLifetimeService  対象インスタンス有効期間ポリシー制御する現在の有効期間サービス オブジェクト取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象インスタンス有効期間ポリシー制御する有効期間サービス オブジェクト取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToHfont この Font識別するハンドル返します
パブリック メソッド ToLogFont オーバーロードされます。 この Font から GDI 論理フォント (LOGFONT) 構造体作成します
パブリック メソッド ToString オーバーライドされます。 この Fontユーザー判読できる文字列形式返します
プロテクト メソッドプロテクト メソッド
明示的インターフェイスの実装明示的インターフェイス実装
  名前 説明
インターフェイスの明示的な実装 System.Runtime.Serialization.ISerializable.GetObjectData SerializationInfo に、オブジェクトシリアル化するために必要なデータ設定します
参照参照

関連項目

Font クラス
System.Drawing 名前空間

その他の技術情報

フォントテキスト使用

Font メンバ

特定のデバイス特定のフォントレンダリングするために必要なテクスチャリソースカプセル化ます。

Font データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Dispose Font クラスによって使用されているすべてのリソース解放します。
パブリック メソッド DrawText オーバーロードされます書式設定されたテキスト描画ます。
パブリック メソッド Equals  オーバーロードされます2 つObject インスタンス等しかどうか判断します。 (Object から継承されます。)
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用適してます。 (Object から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド MeasureString 指定した Font オブジェクト使用し指定した StringFormat オブジェクト書式指定して描画した場合の、指定した文字列計測します
パブリック メソッド OnLostDevice ビデオ メモリ リソースへのすべての参照解放しすべての状態ブロック削除します
パブリック メソッド OnResetDevice デバイスリセット後に設定を再初期化します。
パブリック メソッド PreloadText 書式設定されたテキストビデオ メモリ読み込みデバイスへのレンダリング効率を向上させます
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
参照参照

関連項目

Font クラス
Microsoft.WindowsMobile.DirectX.Direct3D 名前空間

その他の技術情報

Mobile Direct3D プログラミング

Font メンバ

フォント フェイスサイズスタイルの各属性など、テキスト特定の書式定義します。このクラス継承できません。

Font データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ Bold この Font太字かどうかを示す値を取得します
パブリック プロパティ FontFamily この Font関連付けられている FontFamily を取得します
パブリック プロパティ GdiCharSet この Font使用する GDI 文字セット指定するバイト値を取得します
パブリック プロパティ GdiVerticalFont この FontGDI 縦書きフォントから派生したフォントかどうかを示すブール値を取得します
パブリック プロパティ Height フォント行間取得します
パブリック プロパティ IsSystemFont フォントが SystemFonts のメンバかどうかを示す値を取得します
パブリック プロパティ Italic この Font斜体かどうかを示す値を取得します
パブリック プロパティ .NET Compact Framework によるサポート .NET Compact Framework によるサポート SizeInPoints この Fontem サイズ (ポイント) を取得します
パブリック プロパティ Strikeout この Fontフォントを通る水平線指定するかどうかを示す値を取得します
パブリック プロパティ .NET Compact Framework によるサポート SystemFontName IsSystemFont プロパティtrue返す場合は、システム フォントの名前を取得します
パブリック プロパティ Underline この Font下線付きかどうかを示す値を取得します
パブリック プロパティ Unit この Font長さの単位取得します
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Clone 対象Font同一コピー作成します
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信使用するプロキシ生成必要な情報をすべて格納しているオブジェクト作成します。 (MarshalByRefObject から継承されます。)
パブリック メソッド Dispose この Font によって使用されているすべてのリソース解放します。
パブリック メソッド Equals オーバーロードされますオーバーライドされます指定したオブジェクトがこの Font等しかどうか判断します
パブリック メソッド FromHdc デバイス コンテキスト識別する指定した Windows ハンドルから Font作成します
パブリック メソッド FromHfont 指定した Windows ハンドルから Font作成します
パブリック メソッド FromLogFont オーバーロードされます指定した GDI 論理フォント (LOGFONT) 構造体から Font作成します
パブリック メソッド GetHashCode オーバーライドされますFont処理するためのハッシュ コード取得します
パブリック メソッド GetHeight オーバーロードされます。 このフォント行間返します
パブリック メソッド .NET Compact Framework によるサポート GetLifetimeService  対象インスタンス有効期間ポリシー制御する現在の有効期間サービス オブジェクト取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象インスタンス有効期間ポリシー制御する有効期間サービス オブジェクト取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToHfont この Font識別するハンドル返します
パブリック メソッド ToLogFont オーバーロードされます。 この Font から GDI 論理フォント (LOGFONT) 構造体作成します
パブリック メソッド ToString オーバーライドされます。 この Fontユーザー判読できる文字列形式返します
プロテクト メソッドプロテクト メソッド
明示的インターフェイスの実装明示的インターフェイス実装
  名前 説明
インターフェイスの明示的な実装 System.Runtime.Serialization.ISerializable.GetObjectData SerializationInfo に、オブジェクトシリアル化するために必要なデータ設定します
参照参照

関連項目

Font クラス
System.Drawing 名前空間

その他の技術情報

フォントテキスト使用


このページでは「.NET Framework クラス ライブラリ リファレンス」からFontを検索した結果を表示しています。
Weblioに収録されているすべての辞書からFontを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からFont を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Font」の関連用語

Fontのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Fontのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS