次の方法で共有


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
  • gdiCharSet
    フォントに使用する GDI 文字セットを指定する Byte
  • gdiVerticalFont
    新しい Font が GDI 縦書きフォントから派生したフォントかどうかを示すブール値。

例外

例外の種類 条件

ArgumentException

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

解説

gdiCharSet パラメータは、プラットフォーム SDK のヘッダー ファイル WinGDI.h で定義されたリストから値を取得します。familyName パラメータが、アプリケーションを実行するコンピュータにインストールされていないフォントやサポートされていないフォントを指定した場合は、代わりに Microsoft Sans Serif が使用されます。

プラットフォーム

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。

バージョン情報

.NET Framework

サポート対象 : 2.0、1.1、1.0

参照

関連項目

Font クラス
Font メンバ
System.Drawing 名前空間