While working on a bitmap sprite font for an upcoming Xbox 360 game that we’re working on here at Iron Star Media, I asked myself that question that makes us programmers what we are. “Surely, I can automate this…”. And thus was born the Fancy Bitmap Font Generator.
At the moment, this software is very much in it’s infancy. It’s possible to generate the odd italic font that goes outside of the boxes that I’ve made and it’s almost definitely more than possible to get an exception or two if you try hard enough. However, it works – and the output is pretty nice.
Here are some screen shots of the Fancy Bitmap Font Generator in action;
I intend to make the source code for this software available, as soon as I’ve tidied up the code that I hurried through to get our first version put together. I am working on a complete re-modelling of the code to allow for more dynamic implementation of effects (an effects stack if you will, instead of the predefined ones).
Note that this version of the software is very much an early testing build. Over the next couple of weeks I intend to improve the software, making the interface cleaner, and certainly make the whole thing a lot faster. It will go very slowly when you add the shine effect, it might crash. It almost definitely won’t to anything bad to your computer, but we accept no liability if it does.
Features already on the cards include; Support for Unicode characters, Support for an ‘Effects Stack’ so you add as many or few effects as you like to a font.
How to Use (Specifically in XNA Game Projects)
I won’t go into too much detail on how to use this version of the software, as there will be some major changes in the user interface for the next version that will be out in a couple of weeks. However, there are some basic instructions with the software if you click on the ‘info’ button which basically describes what every field on the left side controls. The only thing I’ll say is that it’s wise to leave the first character of the font as a space, unless you know what you’re doing with bitmap fonts.
Once you have generated a font from this piece of software, you will be presented with a large image that represents your sprite font texture. You can get this into your game very quickly with only a few lines of code;
1. Drag and Drop the texture onto your projects ‘Content’ directory.
2. Select Content Processor = Sprite Font Texture – XNA Framework. Make sure that the first character option is set to the first character in your image (leave it as a space if you used the default range). I find you get better fonts if you leave it in ‘colour’ mode, but DXT might work for you too.
3. Load the SpriteFont from your code in the regular way; SpriteFont font = Content.Load(“myFancyFont”);
4. Use it like you would a regular sprite font, through a SpriteBatch.DrawString() call.
Before you download this software, be sure to read the Usage Notes and the License. We’ll still be here when you get back. Right. Now that you’ve had fun reading those, you can grab the initial testing version of this software here;Download Iron Star Media’s Fancy Bitmap Font Generator Version 0.1.0.6
We’ve yet to apply a proper license to this software, so currently the terms of usage are; you can download and use this software indefinitely, free of charge. Any of the assets produced by this software are 100% yours to own (except for any other licenses or usage rights that apply to the font(s) that you’ve used). Use them in your XNA games, your iPhone projects or anything you like. If you use this software to generate sprites for your games, we’d appreciate a small mention somewhere in the credits / on the website (and a free copy of the game would be cool!).
Feedback and Questions
We’d love to hear from you what you think about this utility. Please feel free to drop us a comment using the form below. Alternatively, you can often find me on xnachat.com. My username is JohnWordsworth.