Font.Font
Font(Font, FontStyle)
Initializes a new Font
that uses the specified existing Font
and FontStyle
enumeration.
public Font(Font prototype, FontStyle newStyle)
Parameter | Type | Description |
---|
prototype | Font | The existing Font from which to create the new Font . |
newStyle | FontStyle | The FontStyle to apply to the new Font . Multiple values of the FontStyle enumeration can be combined with the OR operator. |
Exceptions
exception | condition |
---|
ArgumentNullException | prototype is null. |
See Also
Font(string, float)
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)
Parameter | Type | Description |
---|
fontName | String | A string representation of the Font name. |
emSize | Single | The em-size, in points, of the new font. |
Exceptions
exception | condition |
---|
ArgumentOutOfRangeException | emSize is less than or equal to 0, evaluates to infinity or is not a valid number. |
ArgumentNullException | fontName is null. |
See Also
Font(string, float, FontStyle)
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)
Parameter | Type | Description |
---|
fontName | String | A string representation of the Font name. |
emSize | Single | The em-size, in points, of the new font. |
style | FontStyle | The FontStyle of the new font. |
Exceptions
exception | condition |
---|
ArgumentOutOfRangeException | emSize is less than or equal to 0, evaluates to infinity or is not a valid number. |
ArgumentNullException | fontName is null. |
See Also
Font(string, float, GraphicsUnit)
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)
Parameter | Type | Description |
---|
fontName | String | A string representation of the Font name. |
emSize | Single | The em-size of the new font in the units specified by the unit parameter. |
unit | GraphicsUnit | The GraphicsUnit of the new font. |
Exceptions
exception | condition |
---|
ArgumentOutOfRangeException | emSize is less than or equal to 0, evaluates to infinity or is not a valid number. |
ArgumentNullException | fontName is null. |
See Also
Font(string, float, FontStyle, GraphicsUnit, CharacterSet)
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)
Parameter | Type | Description |
---|
fontName | String | A string representation of the Font name. |
emSize | Single | The em-size of the new font in the units specified by the unit parameter. |
style | FontStyle | The FontStyle of the new font. |
unit | GraphicsUnit | The GraphicsUnit of the new font. |
characterSet | CharacterSet | A character set to use for this font. |
Exceptions
exception | condition |
---|
ArgumentOutOfRangeException | emSize is less than or equal to 0, evaluates to infinity or is not a valid number. |
ArgumentNullException | fontName is null. |
See Also
Font(string, float, FontStyle, GraphicsUnit)
Initializes a new Font
using a specified size, style, and unit.
public Font(string fontName, float emSize, FontStyle style, GraphicsUnit unit)
Parameter | Type | Description |
---|
fontName | String | A string representation of the Font name. |
emSize | Single | The em-size of the new font in the units specified by the unit parameter. |
style | FontStyle | The FontStyle of the new font. |
unit | GraphicsUnit | The GraphicsUnit of the new font. |
Exceptions
exception | condition |
---|
ArgumentOutOfRangeException | emSize is less than or equal to 0, evaluates to infinity or is not a valid number. |
ArgumentNullException | fontName is null. |
See Also