Partilhar via


FontDescription Constructor (String, Single, Single)

Note

This constructor is available only when developing for Windows.

Initializes a new instance of FontDescription and initializes its members to the specified font, size, and spacing, using FontDescriptionStyle.Regular as the default value for Style.

Syntax

'Declaration
Public Sub New ( _
         fontName As String, _
         size As Single, _
         spacing As Single _
)
public FontDescription (
         string fontName,
         float size,
         float spacing
)
public:
FontDescription(
         String fontName,
         float size,
         float spacing
)

Parameters

  • fontName
    Type: String
    The name of the font, such as Times New Roman.
  • size
    Type: Single
    The size, in points, of the font.
  • spacing
    Type: Single
    The amount of space, in pixels, to insert between letters in a string.

Exceptions

Exception type Condition
ArgumentNullException fontName is null or an empty string.
ArgumentOutOfRangeException size is less than or equal to zero. Specify a value for this parameter that is greater than zero.

Requirements

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics

Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

See Also

Reference

FontDescription Class
FontDescription Members
Microsoft.Xna.Framework.Content.Pipeline.Graphics Namespace

Platforms

Windows 7, Windows Vista, Windows XP