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)
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
stringThe name of the font, such as Times New Roman.
size
floatThe size, in points, of the font.
spacing
floatThe 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
stringThe name of the font, such as Times New Roman.
size
floatThe size, in points, of the font.
spacing
floatThe amount of space, in pixels, to insert between letters in a string.
fontStyle
FontDescriptionStyleThe 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
stringThe name of the font, such as Times New Roman.
size
floatThe size, in points, of the font.
spacing
floatThe amount of space, in pixels, to insert between letters in a string.
fontStyle
FontDescriptionStyleThe font style for the font.
useKerning
booltrue if kerning information is used when drawing characters; false otherwise.
Properties
Characters
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; }