Table of Contents

Class FontDescription

Namespace
Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly
MonoGame.Framework.Content.Pipeline.dll

Provides information to the FontDescriptionProcessor describing which font to rasterize, which font size to utilize, and which Unicode characters to include in the processor output.

public class FontDescription : ContentItem
Inheritance
FontDescription
Derived
Inherited Members

Constructors

FontDescription(string, float, float)

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.

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

Parameters

fontName string

The name of the font, such as Times New Roman.

size float

The size, in points, of the font.

spacing float

The amount of space, in pixels, to insert between letters in a string.

FontDescription(string, float, float, FontDescriptionStyle)

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

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

Parameters

fontName string

The name of the font, such as Times New Roman.

size float

The size, in points, of the font.

spacing float

The amount of space, in pixels, to insert between letters in a string.

fontStyle FontDescriptionStyle

The font style for the font.

FontDescription(string, float, float, FontDescriptionStyle, bool)

Initializes a new instance of FontDescription using the specified values.

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

Parameters

fontName string

The name of the font, such as Times New Roman.

size float

The size, in points, of the font.

spacing float

The amount of space, in pixels, to insert between letters in a string.

fontStyle FontDescriptionStyle

The font style for the font.

useKerning bool

true if kerning information is used when drawing characters; false otherwise.

Properties

Characters

public ICollection<char> Characters { get; }

Property Value

ICollection<char>

DefaultCharacter

Gets or sets the default character for the font.

[ContentSerializer(Optional = true)]
public char? DefaultCharacter { get; set; }

Property Value

char?

FontName

Gets or sets the name of the font, such as "Times New Roman" or "Arial". This value cannot be null or empty.

[ContentSerializer(AllowNull = false)]
public string FontName { get; set; }

Property Value

string

Size

Gets or sets the size, in points, of the font.

public float Size { get; set; }

Property Value

float

Spacing

Gets or sets the amount of space, in pixels, to insert between letters in a string.

[ContentSerializer(Optional = true)]
public float Spacing { get; set; }

Property Value

float

Style

Gets or sets the style of the font, expressed as a combination of one or more FontDescriptionStyle flags.

public FontDescriptionStyle Style { get; set; }

Property Value

FontDescriptionStyle

UseKerning

Indicates if kerning information is used when drawing characters.

[ContentSerializer(Optional = true)]
public bool UseKerning { get; set; }

Property Value

bool