FNTGen

Help - Resources - Discussion
User avatar
poiuy_qwert
Posts: 548
Joined: Sun Jan 13, 2008 2:14 am

FNTGen

Postby poiuy_qwert » Tue Mar 31, 2009 11:10 pm

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:PathFNTGen" 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: Select all

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: Select all

FNTGen.exe Courier,18 32,255 25,19 0,0 1,1

this can also be written as just:

Code: Select all

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: Select all

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: Select all

FNTGen.exe Courier,18 , 25,19 0,-2 2,2
IskatuMesk
Posts: 329
Joined: Wed May 16, 2007 5:57 pm

Postby IskatuMesk » Wed Apr 01, 2009 1:10 am

PyFNT and FNTGen in action;

Image
Image
TassadarZeratul
Posts: 19
Joined: Fri Jun 05, 2009 7:21 pm

Postby TassadarZeratul » Fri Dec 11, 2009 9:00 am

Image

Oh, for some reason, typing a < or > in the message window causes a crash. This is probably because in the font I'm using, the < and > signs are much larger than normal.
Corbo
Posts: 16
Joined: Tue Feb 26, 2008 11:23 pm

Postby Corbo » Tue Feb 02, 2010 12:56 am

More FNTGen action shots!

Image

Image
Corbo
Posts: 16
Joined: Tue Feb 26, 2008 11:23 pm

Postby Corbo » Tue Feb 02, 2010 10:03 pm

And it's so easyy :P

Return to “PyMS (poiuy_qwert's complete modding suite)”

Who is online

Users browsing this forum: No registered users and 1 guest