Download: FNTGen.zip (2.8MB)
Well I wrote this little program to use a TTF to generate a BMP which can then be imported into PyFNT. I'm not adding this functionality directly to PyFNT for three reasons; FNTGen alone is really big, not many people edit fnt's, and the whole point of exporting the fnt to a bmp is so the person has full control over editing the fnt in their preferred editor. This program is command line only (and I don't plan to add a GUI), but its very simple to generate a font with:
1) Take your font and put it in the same directory as FNTGen
2) Open up a command prompt (hit "windows key+R" then run "cmd")
3) Navigate to the FNTGen folder by typing "cd C:\Path\FNTGen" where C:\Path\ is the correct path to where you unzipped it
4) Now just run FNTGen with the command line, using the format:
CODE
FNTGen.exe FontName,FontSize [LetterStart],[LetterEnd] Width,Height [XOffset,YOffset [ShadowXOffset,ShadowYOffset]]
(Things in square brackets are optional)
FontName: Name of the font file without '.ttf'
FontSize: The size of the font
LetterStart: The ASCII code of the first character in the font (for default fonts they always start on 32, or "space")
LetterEnd: The ASCII code of the last character in the font (for default fonts they always end at 255)
Width: The width that each character will be given in the resulting BMP
Height: The height that each character will be given in the resulting BMP
XOffset: The x-offset to add to each characters x position
YOffset: The y-offset to add to each characters y position
ShadowXOffset: The x-offset to add to the final position of the character, to get the x position of its shadow
ShadowYOffset: The y-offset to add to the final position of the character, to get the y position of its shadow
An example would be:
CODE
FNTGen.exe Courier,18 32,255 25,19 0,0 1,1
this can also be written as just:
CODE
FNTGen.exe Courier,18 , 25,19
If you find that the characters are being drawn too low and the bottoms are being cut off or something like that, you can change to X/Y offsets. For example, if the previous command put the characters 2 pixels too low, you can do:
CODE
FNTGen.exe Courier,18 , 25,19 0,-2
If the default shadow offset of 1,1 doesn't give the correct depth/look, you can change those too.
CODE
FNTGen.exe Courier,18 , 25,19 0,-2 2,2