Neio Notes Share knowledge and experience with you

8Sep/110

Game Font Generator – BMFont

Somebody may face the difficult of drawing text by  using directX or OpenGL  directly. We have to generate character bitmap then use it as texture for showing texts.

BMFont helps us with this task. BMFont provides both GUI window mode and command line mode. In GUI window mode, you can tick what character you need to generate, you will receive a png format font image and configuration file for accessing the font image.

Command line mode is suitable for automatic generating purpose. For example, you write an Unicode encoded text file with the text that you need to display. Then use command line to generate. For example:

bmfont.com -c config.bmfc -o gamefont.fnt -t text.txt 

This command line tell bmfont load config.bmfc and output as gamefont.fnt while all characters present in the text.txt will be added to the font.

Filed under: 经验之谈 No Comments