I needed a fixed size font for a cocos2d project. I didn’t want to use a ttf font but a simple png file. I found a nice Gimp plugin at http://soledadpenades.com to create such a font image.

I did some minor changes to modify the distance between the chars, download the changed version here.

Copy the unpacked .py file into ~/.gimp-2.6/plug-ins. You may change 3 lines to configure this plugin:

1
2
3
4
char_begin = 46
char_end = 58
num_chars = char_end - char_begin
yofs = 5

Using the settings above, you’ll create an image with the chars “./0123456789” and a minus offset of 5 pixels between each char.

If you’re a Windows users you may also take a look at Codehead’s Bitmap Font Generator. This tool is similar to the Gimp plugin, just a bit more “polished”.