Table of Contents

Class LocalizedFontProcessor

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

Custom processor extends the SpriteFont build process to scan over the resource strings used by the game, automatically adding whatever characters it finds in them to the font. This makes sure the game will always have all the characters it needs, no matter what languages it is localized into, while still producing an efficient font that does not waste space on unnecessary characters. This is especially useful for languages such as Japanese and Korean, which have potentially thousands of different characters, although games typically only use a small fraction of these. Building only the characters we need is far more efficient than if we tried to include the entire CJK character region.

[ContentProcessor]
public class LocalizedFontProcessor : ContentProcessor<LocalizedFontDescription, SpriteFontContent>, IContentProcessor
Inheritance
LocalizedFontProcessor
Implements
Inherited Members

Constructors

LocalizedFontProcessor()

public LocalizedFontProcessor()

Properties

PremultiplyAlpha

public virtual bool PremultiplyAlpha { get; set; }

Property Value

bool

TextureFormat

public virtual TextureProcessorOutputFormat TextureFormat { get; set; }

Property Value

TextureProcessorOutputFormat

Methods

Process(LocalizedFontDescription, ContentProcessorContext)

Converts a font description into SpriteFont format.

public override SpriteFontContent Process(LocalizedFontDescription input, ContentProcessorContext context)

Parameters

input LocalizedFontDescription
context ContentProcessorContext

Returns

SpriteFontContent