Dela via


FontDescription Constructor (String, Single, Single)

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.

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
)

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.

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