Tag Archives: Bitmap Fonts

Bitmap Fonts in Corona SDK

Using your own, custom fonts in games and apps is essential to create the right GUI. Sometimes this can be done with a standard font asset drawn natively; however this doesn’t always provide you with enough artistic licence to create what you really need, and in some cases, ie Windows Phone, using native fonts has a huge impact on performance. There is a solution. Bitmap fonts. Although the idea of bitmaps fonts isn’t new, in fact its very old; using them in you Corona projects can typically be a pain. Many years ago, someone wrote bmf.lua, which worked a treat to draw your bitmap fonts onto your scene, however it had a few shortfalls. Corona SDK then released graphics 2.0, which broke bmf.lua completely.

The following article will walk you through my workflow for producing and using bitmap fonts in corona; including a version of bmf.lua that I have updated for the following functions:

  • Corona Graphics 2.0 Compatible
  • Corona SDK image map format compatible
  • .fnt definition file compatible
  • Read the drawn width and height at run-time
  • Re-size the font at run-time, without having to destroy and reinitialize.

Continue reading