Cobalt Dungeon Dev 02: Creating a Bitmap Font for Phaser

You are reading a copy of this article! Visit the original on patreon.com.

In this video we will take a font file (one with a TTF extension) and convert it into a bitmap font (XML and PNG files) for use with the Phaser game engine. Technically these font files can be used for other HTML5 game engines as well, though we'll specifically look at code for loading it into Phaser.

In particular we will use a Bitmap font (non anti-aliased) which we find on the website dafont.com. We will then load the font into a tool called Bitmap Font Generator by AngelCode. There are a few setting which need to be changed so that the font will export properly. Once we save the font we'll need to rename and edit the XML file and its associated image. We also need to do some light post-processing on the PNG file to fix colors and transparency. Finally we load the font into a very simple Phaser project.

Additional Links:

This video was available on Patreon two weeks before being available on YouTube.

Enjoy!

Thomas Hunter II Avatar

Thomas is the author of Advanced Microservices and is a prolific public speaker with a passion for reducing complex problems into simple language and diagrams. His career includes working at Fortune 50's in the Midwest, co-founding a successful startup, and everything in between.