Custom Fonts API

Tired of using the same-old fonts in your games? Well do I have a solution for you! Over the weekend I spent some time writing this brand-spankin’-new fancy-shmancy API for rendering your own fonts using ImageLabels’ ImageRect* properties. In other words, a bitmap like this…

…can turn into text like this!

[size=6]F.A.Q.[/size]
Wow, this is amazing! Where can I play with this myself?
Golly gee wilikers, thanks! You can try it out at this uncopylocked place.

Are you using this in a game? Can I see this in action somewhere?
You sure-as-sugar can! I’ve begun the process of implementing these custom fonts into Mirror Muse. The buttons on the main menu and the tutorial text use the system. Click Play, then choose the tutorial.

How in the world are you pulling this off?
I’m using a bitmap font (an image with letters on it that I chop up) and ImageLabels’ ImageRectOffset and ImageRectSize. Check out more information at this tiny wiki page.

How much work does it take to add a new font?
About 2 minutes of work for me. I’m using software called BMFont to create the bitmaps and the definitions (.FNT file) for where each glyph is on the map. The API reads this definition and renders/creates the ImageLabels in a Frame. You don’t have to manually define the position, size, or kerning of each character in the map.

Does this automatically make my TextLabels/TextButtons pretty?
You can have the API convert all of your TextLabels/TextButtons in your gui with only a few lines of code. Recursion ftw.

Can you add this font…?
No, but you can. Once you get the process down it’s only a few steps to copy the template module for fonts.

Can I use this in my project?
I’m releasing this project under the WTFPL.

Check it out and tell me what you think!

4 Likes

Why should I use this vs these?

I could swear there was another one too.

OT: I just played Mirror Muse since you pointed out that this API was used in the game. The game was really really adicting and I got such an ego-boost after completing challenging levels! It was really great, well done sir.