Subscribe to the RSS Feed Add to Google

Font Generation Tool

July 29, 2009

As I couldn't find an existing tool which met my requirements, I've written by own utility to generate a bitmap font from a true-type font, which is quite useful for when you want to use a font in a game but don't want to buy the full distribution rights to it...

It can be downloaded here (source code included):
PixieFGT_1_0.zip

And the syntax is:
PixieFGT fontname size [spacing] [-antialias] [-texture]

The optional parameter spacing gives you that many empty pixels around each character, so there's room to add things like dropshadow or glow in your image editing software.

The optional flag -texture will give you the characters arranged on a bitmap of power-of-two size, and if the flag is not specified, they will be placed on one long horizontal strip instead (which is what I most often use for fonts in Pixie, as it makes it easier to apply gradients to the font in photoshop).

If you specify -antialias, the font will be generated at 16 times the requested size, and then downsampled, for high quality antialias.

Here's an example of how a generated font bitmap might look:

Pixie Font Generation Tool - Example output

And along with it you also get an XML file which specifies which character can be found in which area of the bitmap.

The XML file also contains kerning information, which you could make use of if you want. What it basically tells you is that if a character with the ascii value matching the "first"-value was rendered, followed immediately by one matching the "second"-value, the second character should be moved horizontally by the specified amount, so that, for example, "A" and "V" are placed closer together than "A" and "L"...

The source code is public domain as usual.


   Digg this Digg this    submit to reddit Add to reddit

<< Using Strings as IDs
48 hour Sidescrolling RPG Competition >>


Comments

There are no comments on this blog entry.

Write a comment








Video Games BlogRankers.com Video Games blogs Directory of Video Games Blogs Blog directory Game Blogs - BlogCatalog Blog Directory Free Page Rank Tool Bloggtoppen.se Blogg om Bloggar.Topplista.se - topplistan med de bästa bloggarna - lägg till din blogg du också! My Zimbio DigNow.net

© Copyright Mattias Gustavsson 2008. All Rights Reserved. Reproduction/republishing of any material on this site without permission is strictly prohibited.