SpriteFont Class (Microsoft.Xna.Framework.Graphics)


Namespace: Microsoft.Xna.Framework.Graphics
Assembly: MonoGame.Framework (MonoGame.Framework.dll
  • C#
  • VB
  • F#
public sealed class SpriteFont

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

The SpriteFont type exposes the following members.

  Platforms Name Description
SpriteFont Initializes a new instance of the SpriteFont class. 
  Platforms Name Description
Characters Gets a collection of the characters in the font. 
DefaultCharacter Gets or sets the character that will be substituted when a given character is not included in the font. 
Glyphs All the glyphs in this SpriteFont. 
LineSpacing Gets or sets the line spacing (the distance from baseline to baseline) of the font. 
Spacing Gets or sets the spacing (tracking) between characters in the font. 
Texture Gets the texture that this SpriteFont draws from. 
  Platforms Name Description
GetGlyphs Returns a copy of the dictionary containing the glyphs in this SpriteFont. 
MeasureString(string) Returns the size of a string when rendered in this font. 
MeasureString(StringBuilder) Returns the size of the contents of a StringBuilder when rendered in this font. 
Supported in:

 Windows DirectX Desktop
 Linux Desktop
 Windows OpenGL Desktop