Printable Version of Topic

Click here to view this topic in its original format

BroodWarAi.com _ PyMS Mac and Windows compatable Modding Suite _ FNTGen

Posted by: poiuy_qwert Mar 31 2009, 03:10 PM

Download: http://www.broodwarai.com/download.php?file=FNTGen (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

Posted by: IskatuMesk Mar 31 2009, 05:10 PM

PyFNT and FNTGen in action;



Posted by: TassadarZeratul Dec 11 2009, 01:00 AM



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.

Posted by: bajadulce Dec 11 2009, 04:58 PM

You should be using Pyfnt to create .BMPS to modify rather than this program or at least modifying the ones that are giving you trouble. This program has limited scope and not all fnts will magically work with this.

Posted by: Corbo Feb 1 2010, 04:56 PM

More FNTGen action shots!




Posted by: bajadulce Feb 1 2010, 07:14 PM

ooooooooooooooo! that is really nice! Need something like this for my dungeons and dragons fantasy mod.

Posted by: Corbo Feb 2 2010, 02:03 PM

And it's so easyy tongue.gif

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)