Font

Font constructor (1 of 6)

Initializes a new Font that uses the specified existing Font and FontStyle enumeration.

public Font(Font prototype, FontStyle newStyle)
ParameterTypeDescription
prototypeFontThe existing Font from which to create the new Font.
newStyleFontStyleThe FontStyle to apply to the new Font. Multiple values of the FontStyle enumeration can be combined with the OR operator.

Exceptions

exceptioncondition
ArgumentNullExceptionprototype is null.

See Also


Font constructor (2 of 6)

Initializes a new Font using a specified size. The character set is set to Default, the graphics unit to Point, the font style to Regular.

public Font(string fontName, float emSize)
ParameterTypeDescription
fontNameStringA string representation of the Font name.
emSizeSingleThe em-size, in points, of the new font.

Exceptions

exceptioncondition
ArgumentOutOfRangeExceptionemSize is less than or equal to 0, evaluates to infinity or is not a valid number.
ArgumentNullExceptionfontName is null.

See Also


Font constructor (3 of 6)

Initializes a new Font using a specified size and style. The character set is set to Default, the graphics unit to Point.

public Font(string fontName, float emSize, FontStyle style)
ParameterTypeDescription
fontNameStringA string representation of the Font name.
emSizeSingleThe em-size, in points, of the new font.
styleFontStyleThe FontStyle of the new font.

Exceptions

exceptioncondition
ArgumentOutOfRangeExceptionemSize is less than or equal to 0, evaluates to infinity or is not a valid number.
ArgumentNullExceptionfontName is null.

See Also


Font constructor (4 of 6)

Initializes a new Font using a specified size and unit. The character set is set to Default, the style is set to Regular.

public Font(string fontName, float emSize, GraphicsUnit unit)
ParameterTypeDescription
fontNameStringA string representation of the Font name.
emSizeSingleThe em-size of the new font in the units specified by the unit parameter.
unitGraphicsUnitThe GraphicsUnit of the new font.

Exceptions

exceptioncondition
ArgumentOutOfRangeExceptionemSize is less than or equal to 0, evaluates to infinity or is not a valid number.
ArgumentNullExceptionfontName is null.

See Also


Font constructor (5 of 6)

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

public Font(string fontName, float emSize, FontStyle style, GraphicsUnit unit, 
    CharacterSet characterSet)
ParameterTypeDescription
fontNameStringA string representation of the Font name.
emSizeSingleThe em-size of the new font in the units specified by the unit parameter.
styleFontStyleThe FontStyle of the new font.
unitGraphicsUnitThe GraphicsUnit of the new font.
characterSetCharacterSetA character set to use for this font.

Exceptions

exceptioncondition
ArgumentOutOfRangeExceptionemSize is less than or equal to 0, evaluates to infinity or is not a valid number.
ArgumentNullExceptionfontName is null.

See Also


Font constructor (6 of 6)

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

public Font(string fontName, float emSize, FontStyle style, GraphicsUnit unit)
ParameterTypeDescription
fontNameStringA string representation of the Font name.
emSizeSingleThe em-size of the new font in the units specified by the unit parameter.
styleFontStyleThe FontStyle of the new font.
unitGraphicsUnitThe GraphicsUnit of the new font.

Exceptions

exceptioncondition
ArgumentOutOfRangeExceptionemSize is less than or equal to 0, evaluates to infinity or is not a valid number.
ArgumentNullExceptionfontName is null.

See Also