Why Can't I Find Bitmap Fonts?

So, I am adding in Fonts to my engine, and need to load some fonts. I was going to load some TrueTypeFonts, but that went ugly fast, so I want to take a simpler approach.

A simple google search of “bitmap fonts” gave me this image:

And since this is pretty easy to decode (you just loop through each row and write it to a texture), I want to start with this. But when I tried to find bitmap fonts, they were scarce, and only found on google images.

So when I did find a few downloads, they just gave me some .ttf’s instead of images! I tried opening .ttf with image editors, and it was incompatible, so it is not just the extension that is different.

So where are these ‘bitmap fonts,’ or am I not searching hard enough?

Look at TheCodingUniverse’s video here. He uses a tool called F2IBuilder for generating the image containing the font.

BMFont. Get it.

Strange he goes into so much detail regarding trivial implementation details, yet completely fails to discuss fixed pitch vs proportional fonts, along with the bare minimum informational requirements of kerning, baseline, and height.

Bitmap fonts don’t scale, so outside specialised use cases they’re pretty much dead. We happen to have one of those specialised use cases.

OpenGameArt has a few bitmap fonts: http://opengameart.org/art-search-advanced?field_art_tags_tid=font , but in general you’ll need to find a font which you can use (note that Germany has particularly strong IP protection for typefaces) and either render it yourself or use a library which handles anti-aliasing, kerning, etc.

I know, I guess it was kinda misleading to refer to that video for just showing the F2IBuilder. :stuck_out_tongue:

I made a pretty good Font Loader that creates bitmap fonts from True Type Font files, and the built in Java Fonts. It is part of my home-brew game engine, GenesisEngine, and you can find the related files here, and here. If you are interested.

You’ve still got to render them. Take a look at this older thread to see some of the subtleties involved: http://www.java-gaming.org/topics/fontpacker-pack-truetype-fonts-into-your-game/30219/view.html

I do a similar thing in my game engine, I use something else to get a little more detail for slightly nicer looking fonts (more detailed advance and what not):


Font font = ....
FontRenderContext context = new FontRenderContext( new AffineTransform(), true, true );
GlyphVector gv = font.createGlyphVector( context, new char[] { c } );
Rectangle2D visual = gv.getVisualBounds();
Rectangle2D logical = gv.getLogicalBounds();

if (logical.getWidth() > 0)
{
	Glyph g = new Glyph( new Tile(), (float)logical.getWidth(),
		(float)visual.getMinX(), (float)visual.getMinY(),
		(float)visual.getMaxX() + 1, (float)visual.getMaxY() + 1 );
	glyphs[c] = g;
}

As it has already been said, specialized usecase.

https://code.google.com/p/libgdx/wiki/Hiero, used to come with Slick (still does I think) but also included in Libgdx. Comes with some effects, easy to add Your own (java2d) and Angelcode is supported both frameworks. In case You use any of those, then it’s win:win.

Bitmap fonts have the advantage of being easy to set up, but they lose scalability and seem to be a little buggy at times.