IPB

Welcome Guest ( Log In | Register )

> 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 +

Posts in this topic
poiuy_qwert   FNTGen   Mar 31 2009, 03:10 PM
IskatuMesk   PyFNT and FNTGen in action;   Mar 31 2009, 05:10 PM
TassadarZeratul   Oh, for some reason, typing a < or > in the ...   Dec 11 2009, 01:00 AM
bajadulce   You should be using Pyfnt to create .BMPS to modif...   Dec 11 2009, 04:58 PM
Corbo   More FNTGen action shots!   Feb 1 2010, 04:56 PM
bajadulce   ooooooooooooooo! that is really nice! Ne...   Feb 1 2010, 07:14 PM
Corbo   And it's so easyy   Feb 2 2010, 02:03 PM


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

 

Lo-Fi Version Time is now: 9th September 2010 - 11:54 PM