Export (0) Print
Expand All

Font Constructor (FontFamily, Single, GraphicsUnit)

Initializes a new Font using a specified size and unit. Sets the style to FontStyle.Regular.

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

public Font(
	FontFamily family,
	float emSize,
	GraphicsUnit unit
)

Parameters

family
Type: System.Drawing.FontFamily

The FontFamily of the new Font.

emSize
Type: System.Single

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

unit
Type: System.Drawing.GraphicsUnit

The GraphicsUnit of the new font.

ExceptionCondition
ArgumentNullException

family is null.

ArgumentException

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

The resulting font has its Style property set to FontStyle.Regular.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft