2019/07/17: Obsoleted by MonogameDistanceFont which uses scalable signed distance fields instead of software rendering. Distance field fonts are more flexible and simpler to use.
Built on top of the excellent C library stb_truetype.
// Load font (accepts filename or system font name)
Font font = new Font("Arial");
// Generate bitmap data
BitmapData data = font.GenerateBitmapData("Hello, MonoGame!", 64);
// Create a texture and set its data
Texture2D fontTexture = new Texture2D(GraphicsDevice, data.Width, data.Height, false, SurfaceFormat.Alpha8);
fontTexture.SetData(data.Alphas);
- Rendering with SpriteBatch
- Rendering with custom pixel shader
- Resizable text field
- Input field
- Rendering without SpriteBatch