LocalizedFontDescription Class (Microsoft.Xna.Framework.Content.Pipeline.Graphics)
Normally, when you add a .spritefont file to your project, this data is
deserialized into a FontDescription object, which is then built into a
SpriteFontContent by the FontDescriptionProcessor. But to localize the
font, we want to add some additional data, so our custom processor can
know what .resx files it needs to scan. We do this by defining our own
custom font description class, deriving from the built in FontDescription
type, and adding a new property to store the resource filenames.
System.Object
Microsoft.Xna.Framework.Content.Pipeline.ContentItem
Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription
Microsoft.Xna.Framework.Content.Pipeline.Graphics.LocalizedFontDescription
Microsoft.Xna.Framework.Content.Pipeline.ContentItem
Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription
Microsoft.Xna.Framework.Content.Pipeline.Graphics.LocalizedFontDescription
Namespace: Microsoft.Xna.Framework.Content.Pipeline.Graphics
Assembly: MonoGame.Framework.Content.Pipeline (MonoGame.Framework.Content.Pipeline.dll 3.8.0.1082)
Assembly: MonoGame.Framework.Content.Pipeline (MonoGame.Framework.Content.Pipeline.dll 3.8.0.1082)
- C#
- VB
- F#
public class LocalizedFontDescription : FontDescription
Syntax for VB is not yet implemented.
Syntax for F# is not yet implemented.
The LocalizedFontDescription type exposes the following members.
Platforms | Name | Description | |
---|---|---|---|
LocalizedFontDescription | Constructor. |
Platforms | Name | Description | |
---|---|---|---|
Characters | (Inherited from FontDescription.) | ||
DefaultCharacter | Gets or sets the default character for the font. (Inherited from FontDescription.) | ||
FontName | Gets or sets the name of the font, such as "Times New Roman" or "Arial". This value cannot be null or empty. (Inherited from FontDescription.) | ||
Identity | Gets or sets the identity of the content item. (Inherited from ContentItem.) | ||
Name | Gets or sets the name of the content item. (Inherited from ContentItem.) | ||
OpaqueData | Gets the opaque data of the content item. (Inherited from ContentItem.) | ||
ResourceFiles | Add a new property to our font description, which will allow us to include a ResourceFiles element in the .spritefont XML. We use the ContentSerializer attribute to mark this as optional, so existing .spritefont files that do not include this ResourceFiles element can be imported as well. | ||
Size | Gets or sets the size, in points, of the font. (Inherited from FontDescription.) | ||
Spacing | Gets or sets the amount of space, in pixels, to insert between letters in a string. (Inherited from FontDescription.) | ||
Style | Gets or sets the style of the font, expressed as a combination of one or more FontDescriptionStyle flags. (Inherited from FontDescription.) | ||
UseKerning | Indicates if kerning information is used when drawing characters. (Inherited from FontDescription.) |
Supported in:
Windows DirectX Desktop
Linux Desktop
Windows DirectX Desktop
Linux Desktop