IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> FNTGen, Easy font generator
poiuy_qwert    Canada
Mar 31 2009, 03:10 PM    Post #1
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


 
Go to the top of the page +
IskatuMesk    Sanctioned Fancy Hats Facility
Mar 31 2009, 05:10 PM    Post #2
PyFNT and FNTGen in action;




 
Go to the top of the page +
TassadarZeratul    in ur butt
Dec 11 2009, 01:00 AM    Post #3


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.


 
Go to the top of the page +
bajadulce    Santa Cruz, California
Dec 11 2009, 04:58 PM    Post #4
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.


 
Go to the top of the page +
Corbo    El Salvador
Feb 1 2010, 04:56 PM    Post #5
More FNTGen action shots!





 
Go to the top of the page +
bajadulce    Santa Cruz, California
Feb 1 2010, 07:14 PM    Post #6
ooooooooooooooo! that is really nice! Need something like this for my dungeons and dragons fantasy mod.


 
Go to the top of the page +
Corbo    El Salvador
Feb 2 2010, 02:03 PM    Post #7
And it's so easyy tongue.gif


 
Go to the top of the page +

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 31st July 2010 - 09:22 PM