BFB creates uncompressed bitmaps with the color depth of your desktop. You will need a program like Paint Shop Pro (by Jasc Software to edit the palette of the resulting bitmap file. In the case of NeHe’s OpenGL tutorials, the bitmaps should be 256-color gray scale images.
More information about ABC Char Widths can be found at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_8icz.asp
32-bit TGA Notes
Font textures saved in “32-bit TGA (RGBA)” format store the font characters in the alpha layer. When you view the font texture, it will look like a big white square, but the alpha layer is where you need to get the data from.
Unless you’re editing the texture in someway to give the font a shadow or something similar, 32-bit RGBA should be avoided since you’re essentially getting the same data a 256-color texture would provide while bloating the file size by four times, which will cost you valuable texture memory as well as bandwidth when you distribute your game.
OpenGL Code Samples
If you’re new to programming OpenGL, I can’t recommend http://nehe.gamedev.net enough!
- NeHe’s Lesson 13: Bitmap Fonts -
- Martin Bell’s “OpenGL Text Drawer” -
Direct3D Code Samples
Both of these samples take advantage of the variable font widths information that you can export using BFB. Very neat stuff!
- Drunken Hyena’s dhFastFont class -
- Greg Wade’s Direct3D font class -
Visual Basic.NET Code Samples
- hazlema’s cGraphicFont class -