EnoughTea / MonoBMFont

Quick and not-so-dirty Monogame BMFont (http://www.angelcode.com/products/bmfont/) support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monogame BMFont support

This project is quite old. Nowdays monogameextended already provides BMFont loading, so use it instead

Library for parsing and using BMFont fonts in .NET. BMFont can be found here: http://www.angelcode.com/products/bmfont/

Usage example for MonoGame:

// Font loading, assuming 'assetName' is something like "Fonts\\Calibri_22_r.fnt":
string fontTextureName = FontData.GetTextureNameForFont(assetName);
var fontTexture = content.Load<Texture2D>(fontTextureName);
var fontFilePath = Path.Combine(contentRootDirectory, assetName);

using (var stream = TitleContainer.OpenStream(fontFilePath)) {
    var fontDesc = FontData.Load(stream);
    var font = new BMFont(fontTexture, fontDesc);
}

// Draw with extension method on SpriteBatch:
spriteBatch.DrawString(bmFont, "Hello, world!", new Vector2(15, 50), Color.White);

About

Quick and not-so-dirty Monogame BMFont (http://www.angelcode.com/products/bmfont/) support

License:Other


Languages

Language:C# 100.0%