Font 2 PNG

License: Freeware
Version: 0.56 (from 7.10.2018 OV signed)
OS: Windows


Poor man’s font 2 png.

Converts font file (ttf, otf, fon) to bitmap font as PNG file.

If “Fixed width” is unchecked the program produces in addition to the png-file a dat-file.

In the dat file there are two 4 byte integers for each character. The first one is starting position (x-coordinate) of a character in the bitmap font, the second is the width of the character in the bitmap font in pixels.

If the background color is saved, the font will be antialiased, otherwise it won’t. If you use black background color.

You can select characters to be save with ASCII range 32 – 128 or 0 – 255.

New in version 0.56

  • Each character can be centered in the given gap in the font
  • Some bugs fixed

Password to download: font2png

(It’s a zip archive)

Below is an example bitmap font of Cabin ttf-font produced by Font 2 PNG.


The program is quite self-explanatory.

When after converting the program asks filename, enter for example font as filename. This creates font.png and font.dat to use with the png-file.

Notice! In all the example programs below the ASCII range is 32 – 126; if range 0 – 255 is used the subtraction of 32 is not needed. When using the range of 0 – 255, remember also change the size of the arrays.

Example code to use font.png and font.dat files in Monkey X.

Constant FONT_HEIGHT must be inserted manually and is the height of the tallest character. In practice the height of the png-file.

Example code to use with mojo2 in Monkey X (with mojo2 fixed width bitmap fonts can be used):

Notice that if you’re for example working with Monkey X and try to save to “” folder new version of the font, the old contents can’t be overwritten. The font data must be saved elsewhere and then copied to “” folder.

Below is an example of use in a Java program with fixed width font:

javva window

The Java code:

And then example of non-fixed width usage:javva-example

The code:


The Monkey X code below works on Android systems:

Feel free to use these codes.

I have a blog post regarding simple text scrollers in Monkey X (and Monkey2). The Monkey X version uses data files of Font 2 PNG, that can be downloaded. Good example in full how to use the files of Font 2 PNG.

See this and this blog post for code to scale a font made with Font 2 PNG in Monkey X. At the end of the posts is a video demonstration of the codes.

I’ve implemented also two examples of own font class to use with Font 2 PNG in Monkey X:

Here’s also a font class for Cerberus X:

I’ve used Font 2 PNG’s fonts in my Old School demonstrations like in the following: