Skip to content

EnoughTea/MonoBMFont

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages