bmfontconvert

BitFontMaker2 to Bitmap Text Font converter

This tool is for converting fonts made with BitFontMaker2 into the FNT and PNG files needed to use them as true Bitmap Text font that can be used with things like the Phaser game engine.

The “normal” way to do this kind of thing is to convert a TrueType font to a Bitmap Text font with BMFont. I find this really tedious when trying to make Bitmap Fonts for pixel-art games, because it is usually overkill and also requires a lot of fine-tuning for the final XML output. I am also using this for very small fonts like the ones created by BitFontMaker2.

This tool was developed by Alex Wellerstein in 2024-2025 for his own use. You are free to use it however you want. I do not claim any copyright on it or its output. It is provided for your use with no warranties, guarantees, etc. Use at your own risk. I have no connection to the creators of BitFontMaker2, BMFont, or Phaser.

Using the tool

You can clone or download the code from this repo, or you can just use the a hosted version of it at https://nuclearsecrecy.github.io/bmfontconvert/src/.

It is written entirely in Javascript and is just embedded in some HTML.

Instructions

1. Create or open a copy of a font from the BitFontMaker2 website.

For example, here is one that I made with the exciting name of “FiveByFour” (its characters are based around an assumption of being five pixels tall and four pixels wide).

Screenshot of the BitFontMaker2 entry for the font FiveByFour

2. Click “Copy & Edit” to open it in the editor:

Screenshot of the BitFontMaker2 editor

3. Click the the little icon that looks like a file with two triangles, which opens the “Data Import / Export” window:

Screenshot of the BitFontMaker2 editor showing the Data Import / Export button.

The font data is all of the JSON code of numbers and symbols that will pop up in the tab. Copy ALL OF IT, exactly as it is, to the clipboard (or download it and then copy it later).

Screenshot of the BitFontMaker2 editor with the Data Import / Export tab open

4. Now open the bmfontconvert tool (this script), and paste that JSON code into the text area in the INPUT section, replacing all existing data there (some data is populated there by default just to illustrate how it works). If the JSON is valid a little green “JSON OK” should pop up at its upper right corner. If there is a problem, it will say “JSON invalid” – try erasing the existing data and pasting it in again, or copying it again from the source.

Screenshot of the INPUT section of the bmfontconvert tool with valid JSON data pasted into it

5. You can probably ignore the SETTINGS section for now. The default settings seem generally good and anything that is missing-but-necessary will be inferred from the font itself. If the results are messed up in some way, you might tweak the settings then. You can hover your mouse over the names of each of them to learn what they are.

6. Click the Convert button in the tool. This will generate the PNG and FNT data and put them in the OUTPUT section. You can then download them manually (right-click and save, or copy-and-paste into a text file), or click the two Download buttons to save them to your computer.

Screenshot of the OUTPUT section of the bmfontconvert tool, showing the CONVERT button and the generated PNG and FNT data

7. If you are using Phaser, you will then need to import the Bitmap Font files into your project to use them. Refer to the Phaser documentation on Bitmap Text.

Notes