Mkfont

A command line utility written in C to help create font textures
Download

Mkfont Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freeware
  • Publisher Name:
  • Zoetrope
  • Operating Systems:
  • Windows All
  • File Size:
  • 79 KB

Mkfont Tags


Mkfont Description

The Mkfont application was developed to be a command line utility written in C to help create font textures. For example, if you want to display the score in an OpenGL game, you can create a polygon for each character in the string you want to display and map the texture of the character onto it. Mkfont can help you create such a texture, but this little program should be used in conjunction with a graphics program such as Photoshop or GIMP. Mkfont needs at least four parameters: the font name, the font size (in points), the name of the file which contains the characters you want and the title of the output files. For example, if you invoke mkfont as follows: mkfont times 20 chars.txt times it will generate two files: times.tga and times.fnt. Times.tga is an 8-bit grayscale TGA file and times.fnt is a text file which contains the coordinates of the character cells. Because the TGA file is only a black rectangle with white text on it, it is not very useful. See the examples below on how to turn this image into something more interesting. Times.fnt looks like this: A = 0 0 19 31 B = 19 0 18 31 C = 37 0 18 31 . . . ' = 33 186 4 31 " = 37 186 10 31 ? = 47 186 12 31 Each line contains the location and dimension of a symbol. For example, the letter A is located at (x=0,y=0), has a width of 19 pixels and a height of 31. Options -b Specifies a bold font. -i Specifies an italic font. -a Turns anti-aliasing off. -w: Specifies the width of the image. -h: Specifies the height of the image. -x: Specifies the left margin of the image. -y: Specifies the top margin of the image. -m: Specifies the left margin, the top margin, the right margin and the bottom margin of a character cell. If you want to add a drop shadow to the characters in a graphics program, specify a right and bottom margin of, say, 4: -m:0,0,4,4.


Mkfont Related Software