The open source framework for developing user interfaces in J2ME Logo
The MicroFont-Maker is a J2SE command line program to create a font strip or a png folder from a TTF file or a custom bitmap.

Processing TTFs
To create a font strip or a png folder from a TTF is necessary to specify which chars must be processed using a plain text file and expliciting this file encoding. A "default" string as the encoding parameter uses the system encoding.
The font size and color (in hexadecimal) must be setted also along with the flags (png and/or dir).

In the next example 'chars.txt' is a file like this one.
java -jar microfont-maker.jar <ttf> chars.txt default 12 AA0000 out -dir -png
The result is a png strip:
And a png folder like this.

Processing Custom Images
First create your custom fonts images using your favorite drawing program:
  • (random chars and numbers)
  • (some Japanese Katakana's characters)
(Note: depending on your browser, transparent pixels may be showed in grey or other colors)

• The fonts don't need to be equally distantiated (this saves you a lot of time, and don't worry for the additional space, it will be ignored), they must be separated at least by 1 pixel.
• They must be laid out in the image horizontally.
• The image should contain grey scale values. (otherwise RGB pixels will be considered as (R+G+B)/255)
• Background must be transparent and fonts may be antialiased.

Example ('chars2.txt'):
java -jar microfont-maker.jar microfont.png chars2.txt default out2 -dir -png
Note that the size and color are not defined when processing custom images.
Output png:
And the png folder here.
The color and size can be changed during runtime using the MIDP2 Extension.

The console ouput shows an array of ints with each char's width, you may want to save this output in some cases, like when using font strips.
Check the Font class javadoc for more info.
Copyright © 2005-2007 J2ME-MWT Team. All Rights Reserved.
Java, J2ME, MIDP and CLDC are Trademarks/Copyright © 1995-2007 Sun Microsystems, Inc.