Creates font textures for games and multimedia applications. Although SpriteFont was initially developed for XNA font textures, it can be used with any other multimedia framework.
Export font metrics (position and size of characters)
Load and save configurations
Technology: Windows Presentation Foundation (WPF)
Requires: .NET Framework 3.5 or higher
Tested on Windows 7, Windows Vista and Windows XP
(Vista and XP users may need to download .NET 3.5 Framework from the Microsoft download pages)
Pricing: Freeware
Latest version: V2.0.1
Windows installer [ Download ] (1,15 MB)
Program files only [ Download ] (763 KB)
Changes to V2.0: Fixed a bug which caused the program to crash when loading invalid font files (thanks to C.F. for the hint!)
Screenshots:
How to use sprite fonts in XNA:
Add the created sprite font texture to your XNA project.
Set the "Content Processor" property to "Sprite Font Texture".
In your code use it like this:
[LoadContent method]
SpriteFont font = content.Load<SpriteFont>("MySpriteFontTextureAssetName");
SpriteBatch batch = new SpriteBatch(GraphicsDevice);
[Draw method]
batch.DrawString(font, "Hello world!", new Vector2(20, 20), Color.White);
Hint 1: Use the SpriteFont.Spacing property to control character spacing (use negative values when using drop shadow or outer glow).
Hint 2: Save your textures in an image format that stores alpha values (like PNG). Otherwise transparency will not be handled correctly.
Annotation from XNA documentation:
As with most types of software, font files are licensed rather than sold.
Font licenses vary from vendor to vendor, but most don't allow redistribution of the fonts, and that includes redistribution of reproductions such as bitmaps containing the rasterized character set.
This is even true of many of the licenses covering fonts that Microsoft supplies with applications and Windows.
Be careful, therefore, to ensure that you have the required license rights to redistribute any font you include as a bitmap containing the rasterized character set in your game!