FontTextureProcessor.Process Method

Note

This method is available only when developing for Windows.

Creates SpriteFontContent from a bitmap.

Syntax

'Declaration
Public Overrides Function Process ( _
         input As Texture2DContent, _
         context As ContentProcessorContext _
) As SpriteFontContent 
public override SpriteFontContent Process (
         Texture2DContent input,
         ContentProcessorContext context
)
public:
SpriteFontContent Process(
         Texture2DContent input,
         ContentProcessorContext context
) override

Parameters

Return Value

Type: SpriteFontContent
The font data.

Exceptions

Exception type Condition
ArgumentNullException input is null.
InvalidOperationException A character cannot be mapped to a glyph index: it is already mapped to a glyph index.

Remarks

Each character should be arranged on the bitmap in a grid ordered from upper left to lower right. Monochrome characters should use white for solid areas and black for transparent areas. To include multicolored characters, add an alpha channel to the bitmap and use that to control which parts of the character are solid. Fill the spaces between each character and around the edges of the grid with a specific magenta color having the value Red:255 Green:0 Blue:255 Alpha:255. The processor packs the characters together as tightly as possible, eliminating any wasted space in the original grid.

Requirements

Namespace: Microsoft.Xna.Framework.Content.Pipeline.Processors

Assembly: Microsoft.Xna.Framework.Content.Pipeline (in microsoft.xna.framework.content.pipeline.dll)

See Also

Reference

FontTextureProcessor Class
FontTextureProcessor Members
Microsoft.Xna.Framework.Content.Pipeline.Processors Namespace

Platforms

Windows 7, Windows Vista, Windows XP