Class FontDescription
- 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, FontDescriptionStyle, bool)
Initializes a new instance of FontDescription using the specified values.
public FontDescription(string fontName, float size, float spacing, FontDescriptionStyle fontStyle = FontDescriptionStyle.Regular, bool useKerning = false)
Parameters
fontNamestringThe name of the font, such as Times New Roman.
sizefloatThe size, in points, of the font.
spacingfloatThe amount of space, in pixels, to insert between letters in a string.
fontStyleFontDescriptionStyleThe font style for the font.
useKerningbooltrue if kerning information is used when drawing characters; false otherwise.
Properties
Characters
Retrieves the set of characters to include in the processor output.
public ICollection<char> Characters { get; }
Property Value
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
Size
Gets or sets the size, in points, of the font.
public float Size { get; set; }
Property Value
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
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
UseKerning
Indicates if kerning information is used when drawing characters.
[ContentSerializer(Optional = true)]
public bool UseKerning { get; set; }