FontDescription Constructor (String, Single, Single, FontDescriptionStyle)

Initializes a new instance of FontDescription and initializes its members to the specified font, size, spacing, and style.

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

Syntax

public FontDescription (
         string fontName,
         float size,
         float spacing,
         FontDescriptionStyle fontStyle
)

Parameters

  • fontName
    The name of the font, such as Times New Roman.
  • size
    The size, in points, of the font.
  • spacing
    The amount of space, in pixels, to insert between letters in a string.
  • fontStyle
    The font style for the font.

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.

See Also

Reference

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

Platforms

Windows XP SP2, Windows Vista