View Full Version : Program/tool to make bitmap fonts
Jack Norton
08-09-2005, 02:12 PM
I know there are many ways to use TTF fonts in real-time inside a game (the new PTK just added support for them), but what I'm looking for is a program that takes a TTF fonts and writes out a PNG image, so I can add nice effects in photoshop (drop shadows, gradient layers, etc).
I don't need any fancy stuff, just that. I was already using a program called BitFontMaker, but the problem is that it uses character sets from zero to 255, filling the texture with unused/unwanted characters... :(
If anyone knows a better solution I'd like to hear it! :cool:
If its bitmapfontbuilder you can also choose NEHE mapping, giving you half that many characters (from space [0x20] upwards). This way you can either put 2 fonts into one texture or using a texture with half size.
Dominique Biesmans
08-09-2005, 03:03 PM
Fontext (http://www.zen28085.zen.co.uk/playerfactory/fontext/), is pretty nice and allows you to pick exactly those characters you need. (has some built-in stuff like gradients & outlines)
Emmanuel
08-09-2005, 03:12 PM
Otherwise you can just render it with ptk and dump the screen to an image, then apply your effects and make a bitmap font with FontAnalyze :)
Best regards,
Emmanuel
soniCron
08-09-2005, 03:36 PM
For what it's worth, I wrote a little FilterMeister script to analyze an image and section each character in an image and output their coordinates to a file. This is useful because:
The characters don't have to be evenly spaced
You can create the fonts right in Photoshop or your favorite Photoshop plugin enabled application
You can use a single layer for all the characters and apply effects to all characters at once
Let me know if you want me to send it to you.
Jack Norton
08-09-2005, 04:17 PM
Well your script Sonicron seems really what I need ! check your PM ;)
DangerCode
08-09-2005, 05:25 PM
If anyone knows a better solution I'd like to hear it! :cool:
I haven't used it yet, but the PopCaps framework comes with a font builder tool.
Pallav Nawani
08-10-2005, 01:48 AM
Hi
Here is the program I use (Attached). I downloaded it from the net and modified it for my use. Needs SDL, SDL_image and SDL_ttf installed. Should work on both Windows & Linux. Input to the program is stored in a file named fontdesc.txt. The program will output a bmp file with the rendered font.
It will also output a fontmetrics file, it has the extension .fm The fontmetrics file contains the coordinates of the font in the image. It has 256 entries of size SDL_Rect. SDL_Rect is defined as:
typedef struct{
Sint16 x, y;
Uint16 w, h;
} SDL_Rect;
Now just load the image, load the coordinates and you are ready to go.
SDL_Rect frect[256];
...
fread(&frect, sizeof(SDL_Rect), 256, metrics_file_pointer);
etc.
hth,
Pallav
Larry Hastings
08-10-2005, 02:26 AM
A couple years ago I took a fella's open-source bitmap font generator (called "MudgeFont"), cleaned it up some, and made a web page for it. You can find it here (http://www.midwinter.com/~lch/programming/mudgefont/).
MudgeFont supports monospaced and proportionally-spaced fonts, and generates all the data you'll need to render the font in an XML file. If you don't like XML, I've included a Python script that reads the MudgeFont output; a little hacking and it will produce whatever format you prefer.
It doesn't generate PNG files, it generates TIFF files. Easy to convert to PNG if you prefer, but TIFF files compress so well that I just ship 'em, myself.
Hiro_Antagonist
08-10-2005, 08:51 AM
As I posted in another thread recently, the PopCap Framework offers a tool (also called Font Builder, I think -- maybe the same one?) that creates bitmap fonts and data files.
I don't know if they built it themselves or got it from somewhere else, but it's a nice little tool and I used it to make fonts for my game, Land of Legends. (I made the font loading/parsing/drawing code myself though. Didn't take long.)
-Hiro_Antagonist
Travis Dorschel
08-10-2005, 09:13 AM
I have used the Bitmap Font Generator from AngelCode http://www.angelcode.com. It outputs both a bitmap and a data file with coordinates for each character. Looks like it was recently updated as well.
http://www.angelcode.com/products/bmfont/
Jack Norton
08-10-2005, 11:30 AM
Thanks guys, looks like I have only to choose :)
Davaris
08-10-2005, 01:48 PM
I just tried MudgeFont and all I get is a black square where the fonts should appear. :)
Jack Norton
08-10-2005, 03:01 PM
I just tried MudgeFont and all I get is a black square where the fonts should appear. :)
You must be doing something wrong since I just finished to make 3 fonts set with that tool :D
Davaris
08-10-2005, 06:13 PM
Yes I didn't realise you had to type in the letters yourself. All the other font programs I've used give you a default list. I quite like the way he's done it though. It's an excellent tool.
vBulletin v3.6.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.