Font.Font(String, Single, FontStyle, GraphicsUnit, Byte) Constructor

Initializes a new Font using a specified size, style, unit, and character set.

Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)

public Font (
	string familyName,
	float emSize,
	FontStyle style,
	GraphicsUnit unit,
	byte 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
Not applicable.



A string representation of the FontFamily for the new Font.


The em-size of the new font in the units specified by the unit parameter.


The FontStyle of the new font.


The GraphicsUnit of the new font.


A Byte that specifies a GDI character set to use for this font.

Exception typeCondition


emSize is less than or equal to 0, evaluates to infinity, or is not a valid number.

The gdiCharSet parameter takes a value from the list defined in the Platform SDK header file WinGDI.h. Windows Forms applications support TrueType fonts and have limited support for OpenType fonts. If the familyName parameter specifies a font that is not installed on the machine running the application or is not supported, Microsoft Sans Serif will be substituted.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions