Getting more Fonts!

All hail the bitmap

I added bitmap fonts earlier to handle writing text in the framework.
I’ve used the great CBFG by Codehead, to generate the font data I wanted (.BMP + CSV data).
I made a small executable to bundle the font image and the data into one .bitmapfont file (compressed using zlib). The framework was then able to open that file and extract the necessary information (texture & character data) to then be used to display text.

I only had like 2 fonts available. Getting the correct file with the correct format was tedious, that’s why I decided to take a look at CBFG’s source code.
I modified it enough so I was able to make it export all the fonts available with the particular data I needed (4 font size bitmaps + csv data, + bold versions).

I now have 221 fonts available, ready to be used by the framework !
I will now modify how the fonts are accessed.

I’m tempted to build one big compressed file, add an index for performance, and embed it to the framework.

So then, each font that’s required can be retrieved from the compressed asset in memory.
On other improvements, I added an italic effect on the text drawing classes (a simple shear matrix).

I will modify the font part, then post a picture of my efforts.

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s