Class FontImporter
Provides methods for reading font files for use in the Content Pipeline.
[ContentImporter(new string[] { ".ttf", ".otf" }, DisplayName = "Sprite Font Importer - MonoGame", DefaultProcessor = "FontDescriptionProcessor")]
public class FontImporter : ContentImporter<FontDescription>, IContentImporter
- Inheritance
-
FontImporter
- Implements
- Inherited Members
Properties
CharacterRegions
Retrieves the set of characters to include in the processor output.
public List<CharacterRegion> CharacterRegions { get; set; }
Property Value
DefaultCharacter
Gets or sets the default character for the font.
public char? DefaultCharacter { get; set; }
Property Value
- char?
ResourceFiles
Allows including extra characters as specified by the resource files.
public List<string> ResourceFiles { 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.
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.
public bool UseKerning { get; set; }
Property Value
Methods
Import(string, ContentImporterContext)
Called by the XNA Framework when importing a font file to be used as a game asset. This is the method called by the XNA Framework when an asset is to be imported into an object that can be recognized by the Content Pipeline.
public override FontDescription Import(string filename, ContentImporterContext context)
Parameters
filenamestringName of a game asset file.
contextContentImporterContextContains information for importing a game asset, such as a logger interface.
Returns
- FontDescription
Resulting game asset.