Creating SpriteFont from AngelCode FNT

Roman Shapiro edited this page Jul 14, 2018 · 2 revisions

Myra allows to create SpriteFont in the runtime from AngelCode's BMFont ASCII .fnt.
Following code archives that:

  // Load .fnt(which is ordinary text file) into the memory
  string data = File.ReadAsText("myfont.fnt");

  // Create SpriteFont
  SpriteFont font = SpriteFontHelper.LoadFromFnt(data, textureRegion);

Where textureRegion is TextureRegion object, containing font glyphs.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.