I needed a fixed size font for a cocos2d project. I didn’t want to use a ttf font but a sim­ple png file. I found a nice Gimp plu­gin at http://soledadpenades.com to cre­ate such a font image.

I did some minor changes to mod­ify the dis­tance between the chars, down­load the changed ver­sion here.

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

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

Using the set­tings above, you’ll cre­ate an image with the chars “./0123456789″ and a minus off­set of 5 pix­els between each char.

If you’re a Win­dows users you may also take a look at Codehead’s Bitmap Font Gen­er­a­tor. This tool is sim­i­lar to the Gimp plu­gin, just a bit more “polished”.