xfontgen
v1.2.0
An utility that generates a bitmap-font texture (sprite sheet) that is compatible with the SpriteFont and FontTextureProcessor included in MonoGame and FNA (successors to the Microsoft's XNA Framework).
Get the latest version in Releases, unzip it to a folder,
and run xfontgen.
The app can be run on the following platforms:
Executing the app requires .NET 8.0 Runtime to be installed.
When adding the generated PNG texture to your content pipeline, make sure to set the following content settings:
Such a sprite font can then be loaded into the SpriteFont object:
_spriteFont = Content.Load<SpriteFont>("TestFont");Which can then be drawn by regular means of SpriteBatch.DrawString as follows:
_spriteBatch.Begin();
_spriteBatch.DrawString(_spriteFont, "The quick brown foxrnjumps over the lazy dog.",
new Vector2(30, 30), Color.MediumSpringGreen);
_spriteBatch.End();
Code licensed under the MIT License.