Table of Contents

Class FontImporter

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

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

List<CharacterRegion>

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

List<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.

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.

public bool UseKerning { get; set; }

Property Value

bool

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

filename string

Name of a game asset file.

context ContentImporterContext

Contains information for importing a game asset, such as a logger interface.

Returns

FontDescription

Resulting game asset.