TGB Font Creation Tool
by Joe Rossi · 08/01/2007 (11:02 pm) · 11 comments
Download Code File
This tool will hopefully make life easier for people who want to edit TGB fonts in an image editor, import them into their game and use them with t2dTextObjects. Seems to be compatible with all versions of TGB, from 1.1.3 to 1.6.
The pasted ReadMe.txt file follows
INSTALLATION:
Simply drop this into your game/resources folder, and you should see a new button in the editor.
It will be black and have a big "F" on it, when you hover it will say "Font Creation Tool".
USAGE:
Click once to bring up the font menu.
Select a font and a font size.
Click "OK".
Now there will be a font image in your game/common/ui/png folder.
Edit that in your preferred image manipulation program (I use GIMP).
When you finish editing, click the FontBoy button again to load the image.
Now you can load it and use it on a t2dTextObject with a function like so:
So the call would look something like this:
Notes/issues:
*Creating "Baltic" versions of any font seems to crash the engine (TGB 1.5.0 anyway)
*You may need to edit the weight value if you want more space between fonts, I left it at 0.
*You'll have to create and edit a new font for each font size you want
*This probably won't work with older versions of TGB.
This tool will hopefully make life easier for people who want to edit TGB fonts in an image editor, import them into their game and use them with t2dTextObjects. Seems to be compatible with all versions of TGB, from 1.1.3 to 1.6.
The pasted ReadMe.txt file follows
INSTALLATION:
Simply drop this into your game/resources folder, and you should see a new button in the editor.
It will be black and have a big "F" on it, when you hover it will say "Font Creation Tool".
USAGE:
Click once to bring up the font menu.
Select a font and a font size.
Click "OK".
Now there will be a font image in your game/common/ui/png folder.
Edit that in your preferred image manipulation program (I use GIMP).
When you finish editing, click the FontBoy button again to load the image.
Now you can load it and use it on a t2dTextObject with a function like so:
function loadCustomFont( %name, %size, %weight){
%pngdir = "pngs/";
%fontdir = "common/ui/cache/";
%fileName = %fontdir @ %pngdir @ %name SPC %size @ ".png";
importCachedFont( %name, %size, %fileName, %weight, 0);
}So the call would look something like this:
loadCustomFont( "Seabird SF", 80, 0 );
Notes/issues:
*Creating "Baltic" versions of any font seems to crash the engine (TGB 1.5.0 anyway)
*You may need to edit the weight value if you want more space between fonts, I left it at 0.
*You'll have to create and edit a new font for each font size you want
*This probably won't work with older versions of TGB.
#2
Thank you very much! This is awesome...would be nice if GG built this into TGB. It is a must have feature.
-Aaron
01/19/2008 (1:57 pm)
Works with 1.6.Thank you very much! This is awesome...would be nice if GG built this into TGB. It is a must have feature.
-Aaron
#3
02/04/2008 (11:39 am)
Can you send me/link an example of script using this with a t2dTextObject. I can't seem to get it to work.
#4
02/04/2008 (11:49 am)
Yes, an example would be nice. I got this tool to generated the bitmap nicely, but I could never get the custom font loaded and working.
#5
Thanks.
04/15/2008 (10:38 am)
Yeah, I neither managed to get working this tool properly, I only get a bunch of opaque boxes where I want letters. I would really appreciate a complete example using this tool.Thanks.
#7
Now after you load the font with that function you can use your new font anywhere you like so long as you set its fontsize to that very same fontsize you used when creating the font.
08/01/2008 (9:00 am)
Hey guys.. there isn't really anything fancy you need to do. Just be sure you use the code I posted here and call loadCustomFont( yourfontname, yourfontsize , 0 );where yourfontname and yourfontsize are the same as what you used when creating the font in the editor. If you don't do this before using the font, it won't work or will show up as the usual white font.
Now after you load the font with that function you can use your new font anywhere you like so long as you set its fontsize to that very same fontsize you used when creating the font.
#8
Can we use this font into guiTextCtrl or other gui control also. I was confused because in this thread only talk about t2dTextObjext.
If We can use this changed font through guiTextCtrl or other then how we can use? Do we need to define custom profile to use in gui controls something like "GuiMyFontProfile". if so in definition of custom profile how we can write all definition.
thnaks
08/28/2008 (10:29 pm)
Hi,Can we use this font into guiTextCtrl or other gui control also. I was confused because in this thread only talk about t2dTextObjext.
If We can use this changed font through guiTextCtrl or other then how we can use? Do we need to define custom profile to use in gui controls something like "GuiMyFontProfile". if so in definition of custom profile how we can write all definition.
thnaks
#9
?
06/15/2009 (3:50 pm)
Do you know if this works for version 1.7.4 because I am having a hard time getting this to work?
#11
03/10/2011 (11:04 am)
Been using fontboy myself, seems your mileage varies depending upon the font you pick. 
Torque Owner Dmitriy Stukalov
Thank you for your script!