Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What tool do you use to convert ttf fonts to bitmap fonts?

Following is a list of features I'm looking for. I'd be happy with any tool really, but one that had these features would be better.

  • outputs power-of-2 texture atlas
  • parsible config file (so I don't have to use their rendering library)
  • output kerning information
  • cross platform
  • a rendering library would be great if it lets me make the actual OpenGL calls.

So what tool have you used? Were you happy with it?

share|improve this question

closed as off-topic by Byte56 Oct 27 '13 at 16:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions that are about "which tech to use" are outside the scope of the site. For more information, see this meta post" – Byte56
If this question can be reworded to fit the rules in the help center, please edit the question.

I mentioned cross platform as I program on a Linux machine. I do dual boot Windows7 so I can play games, but I generally don't develop there. – deft_code Aug 14 '10 at 7:04

12 Answers 12

up vote 16 down vote accepted

Font Builder

Font Builder does almost everything I need. Both Font Studio and Angel Code's BMFont and perform similar tasks. Here are some of Font Builders features.

  • A QT app, and so works equally well on all platforms.
  • Open source so it can easily extend the app if needed
  • Designed to allow custom image and description(layout) exporters, making it even easier to extend
  • Loads fonts from the filesystem instead of windows registry. This makes it a ton easier to generate texture fonts from my own TTFs.
  • Auto sizes the final image so I don't need to guess( like in FontStudio). Further, these textures can be constrained to be power of 2 sizes.
  • Kerning pairs are supported, so that info can be exported if your TTF uses them.

It's not all perfect however. The default layout plugins suck. The Box layout tool just fills the texture from top left to bottom right using the characters alphabetically. Not very efficient. I changed it to sort the characters by height first and quickly improved its efficiency (a 2 line change).

share|improve this answer
BmFont does the job, it had good options and i can use texture more than 128x128 size, Thanks Only thing needed was right export setting like png texture and 32-bit font type – Diljeet Feb 19 '14 at 6:26

Google showed quite a few of those beasts. This might be close to what you're after

You mention cross-platform, but do you mean the tool, or the output? (which would be cross platform maybe apart from endianness)

share|improve this answer
Great tool but it will only generate bitmaps from your system fonts. I have a particular TTF file I'd like to use. Further it doesn't like wine very much. – deft_code Sep 9 '10 at 6:07
Couldn't you add the TTF as a system font? – Kaj Sep 9 '10 at 17:37

Try FontStudio:

It's made especially for creating bitmap fonts for games.

I post a link to the Ogre3D forum, because it hasn't got a home of its own currently.

Find a link to the latest version in the last post of that topic (page 2).

share|improve this answer
Great tool but it will only generate bitmaps from your system fonts. I have a particular TTF file I'd like to use. – deft_code Sep 8 '10 at 5:49
Hey, I'm the creator of Font Studio, I've put the source to Font Studio up on bitbucket. – Mikepote Feb 17 '13 at 16:11

I have used this tool in the past: It works really nice and has a lot of options

share|improve this answer
This looks promising. However, it's not free for comemrcial use. A commercial version is can be had for 20-30 bucks. – deft_code Aug 14 '10 at 15:50

There are many complicated and feature-rich tools out there but my favorite tool for building bitmap fonts is Codehead's Bitmap Font Generator (CBFG). It's a simple tool which does one thing very well. It's clearly documented with tips for implementation.

Like most bitmap font creators, it is of course graphics API independent because it simply exports an image (and an easy to read data structure). However, implementing your own text-rendering system, in OpenGL or Direct3D, is not too difficult--render a quad for each letter and apply the bitmap font texture with appropriate coordinates.

I hope this helps!

Note: This is a Win32 application only, but I still recommend it!

share|improve this answer

A great tool for the mac is Glyph Designer and has become the tool of choice among Cocos2D users. It has many features and has recently been updated to include command line support!

share|improve this answer
It's generally considered poor form here not to clearly disclose your affiliation with products you're recommending. – Josh Petrie Jan 6 '13 at 18:58

The last time I was looking for this (for an iPhone game), I tried various options but couldn't find one that did everything I wanted. I needed to render a single texture using very small characters from a commercial TTF font. I needed to be able to specify character ranges so it would only contain the characters I needed. I wanted it to pack the glyphs as tightly as it could. I needed texture coordinates at runtime. I didn't care about "real" kerning, but I needed glyph measurements at runtime so it would be spaced sensibly. So I wrote a small Windows app that rendered all the characters and saved out the ABC spacings (as reported by Windows) along with texture coordinates.

BTW, if you want to render very small text (like less than 16 pixels high) under XP or Vista, you will run into shortcomings with Windows' anti-aliasing. An easy fix for me was to use to get transparent supersampling. If I were starting over, I'd probably take the same approach but look at FreeType2 instead of native text rendering.

If your text isn't updated often, you could just use the platform's text rendering (or maybe FreeType) to render whole chunks to texture as needed at runtime. Then you just need to render a single quad for each string, but the texture allocation gets more complicated. On the upside, though, you get flawless text rendering and layout for free on those difficult Asian languages along with your significantly faster GL code. Rendering lots of individual characters is expensive, even with degenerate tri strips or whatnot.

share|improve this answer

On the Mac you can only use Hiero ( as far as I know. It is not as powerful as the above, but with a little bit of Photoshop magic it'll do.

share|improve this answer
I can only discourage from Hiero. It was always a few pixels off when I used it. Tested with several fonts. But I think there's no other OSX solution. – martinpi Sep 16 '10 at 22:15

The keyword you're looking for is a "rasterizer". XNA has one built in. A quick Google search brings up FreeType. I'm not sure what else is out there.

share|improve this answer
FreeType is more of a "font-rasterization-library". It isn't exactly an application that creates textures (with power of 2) from fonts. FreeType would be a good choice if you decided to write such a tool yourself though. – bummzack Aug 14 '10 at 8:14

If you want an interactive tool you may want to take a look at FontForge, which is a full font editor that supports a variety of tools for converting TTF fonts into bitmap formats. It supports various types of scripting, so you should be able to integrate it into a pipeline as well.

share|improve this answer
AFAIK FontForge can create Bitmap-Fonts, but these are fundamentally different from what the OP needs. A Bitmap-Font is like a font file but contains bitmaps (preferably in various sizes) for each character. He needs a font to be rendered to a texture, so the result won't be a bitmap-font but an image. – bummzack Aug 14 '10 at 8:02

a new bitmap font generator has been released for OS X: bmGlyph ( available only on the mac app store. ouputs font atlas and bitmaps (hd/sd) with a lots of feature.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.