Custom Fonts in TGB
by Deozaan · in Torque Game Builder · 07/30/2008 (5:49 pm) · 10 replies
Will someone please tell me how to add fonts to TGB? Also, do certain font types have to be used? I have .TTF and .FON type fonts I would like to include in my project.
Thanks in advance!
Thanks in advance!
#2
Then I looked at the code it generated to see how to create text objects in script using the font.
Bad news is that it seems to not recognize fonts that are of the .fon extension.
08/01/2008 (12:52 am)
Well this was kind of messy but the way I got it to create the UTF was to go into the editor and create a t2dTextObject and select the font from the drop down list, and save the level.Then I looked at the code it generated to see how to create text objects in script using the font.
Bad news is that it seems to not recognize fonts that are of the .fon extension.
#3
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13348
I think a few games already have used it to make their fonts :)
Just be sure you follow the directions exactly because if you don't it definitely won't work.
08/01/2008 (9:02 am)
Yes, you can try my font plugin tool here:www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=13348
I think a few games already have used it to make their fonts :)
Just be sure you follow the directions exactly because if you don't it definitely won't work.
#4
Your font tool has some problems in TGB 1.7.4.
1) The "F" doesn't show up on the button in the Builder, so it's hard to locate.
2) The list of fonts to import is not alphabetized, making it very difficult to locate the font I want to import.
3) The instructions say to edit the png image created with Font Boy, but it doesn't specify in what way the image is supposed to be edited.
4) No instructions are given on how to actually use an image as a font. How do I make a textObject pick the correct frames of the imageMap for each letter so that it shows up correctly? This part should really be clarified in the instructions.
5) I tried to import a pixel font but Font Boy seems to apply anti-aliasing to the images it creates, making it unreadable at the small font size it is intended for.
If you fixed these problems, clarified the instructions, and perhaps added some pictures to your resource to guide people along, this would indeed be a very useful tool. As of now--and judging by the comments in your resource--it's a bit too difficult to figure out how to get to work.
08/01/2008 (12:05 pm)
Joe,Your font tool has some problems in TGB 1.7.4.
1) The "F" doesn't show up on the button in the Builder, so it's hard to locate.
2) The list of fonts to import is not alphabetized, making it very difficult to locate the font I want to import.
3) The instructions say to edit the png image created with Font Boy, but it doesn't specify in what way the image is supposed to be edited.
4) No instructions are given on how to actually use an image as a font. How do I make a textObject pick the correct frames of the imageMap for each letter so that it shows up correctly? This part should really be clarified in the instructions.
5) I tried to import a pixel font but Font Boy seems to apply anti-aliasing to the images it creates, making it unreadable at the small font size it is intended for.
If you fixed these problems, clarified the instructions, and perhaps added some pictures to your resource to guide people along, this would indeed be a very useful tool. As of now--and judging by the comments in your resource--it's a bit too difficult to figure out how to get to work.
#5
2) See the * below.
3) It says pretty clearly in the instructions, to edit the image with an image editor such as GIMP or Photoshop.
4) That's because if you follow the instructions there is nothing special to do beyond using the same font name and fontsize you used when creating the font. You can follow any example code containing textObjects and it will work.
5) It won't look perfect for every font, your mileage will vary. It's slightly better than nothing. You can possibly play with the source and adjust the "weight". It may improve the look of some fonts.
*You have the source so if you think you can improve it please do ;) I don't have the time, I do this all on a very part time basis and I'm trying to finish a game here. Also you don't need to use "font boy", you can just rip out the functions it uses and call them directly to get your fonts working. Or even make your own editor that has everything the way you like it.
As for the people on the comments.. no offense to them and I hate to be harsh, but I simply don't have time to teach every TGB newb how to create a textObject, or how to speak English, and I really don't have time to spend trying to help them figure out which step they forgot to follow.
Font boy seems work fine for plenty of people and it works for me here...so I'm sorry but if you can't get it to work it must a user issue :/
08/01/2008 (7:30 pm)
1) I'm running TGB 1.7.4 and it definitely does show up in my editor. Make sure you put it in the right "resources" folder (the one in your "games/gamename" directory).2) See the * below.
3) It says pretty clearly in the instructions, to edit the image with an image editor such as GIMP or Photoshop.
4) That's because if you follow the instructions there is nothing special to do beyond using the same font name and fontsize you used when creating the font. You can follow any example code containing textObjects and it will work.
5) It won't look perfect for every font, your mileage will vary. It's slightly better than nothing. You can possibly play with the source and adjust the "weight". It may improve the look of some fonts.
*You have the source so if you think you can improve it please do ;) I don't have the time, I do this all on a very part time basis and I'm trying to finish a game here. Also you don't need to use "font boy", you can just rip out the functions it uses and call them directly to get your fonts working. Or even make your own editor that has everything the way you like it.
As for the people on the comments.. no offense to them and I hate to be harsh, but I simply don't have time to teach every TGB newb how to create a textObject, or how to speak English, and I really don't have time to spend trying to help them figure out which step they forgot to follow.
Font boy seems work fine for plenty of people and it works for me here...so I'm sorry but if you can't get it to work it must a user issue :/
#6
I can't help but feel some of that "no offense and I hate to be harsh, but--" is directed at me. It feels a bit insulting for you to imply that I'm just a lowly newb who can't speak English. I realize those statements were directed at those that commented on your resource, but I tend to side with them, since I've read your instructions and am still quite obviously confused. I just want to say that if your documentation is hard for people to figure out, or if your resource doesn't work as advertised for everyone, that is not the user's problem. That's your problem. Don't try to pass the buck off to the users and call them stupid at the same time. After all, if they're so stupid, how on earth are they going to figure out how to fix the problem themselves?
I'm willing to admit when I'm wrong or if I make a mistake. But your instructions fail me from the very beginning, during the INSTALLATION step. That doesn't instill in me a great amount of faith in the rest of your directions.
So let's see how stupid I am:
1) If I understand you correctly, if my project name is Universe, the files should go in Universe/resources/font_boy/ ? That's what I did and the F didn't show up.
Screenshot of the Directory structure
Screenshot of FontBoy with no Icon in Editor
3) I understand what an image editor is and what some of the more widely used applications are. But what sort of editing needs to be done to the images after I open them in GIMP or Photoshop? In what ways am I supposed to edit the image that Font Boy generates for me? In other words, is there a reason why I would need to edit the image or should it work how it is when Font Boy creates it?
08/02/2008 (1:53 am)
Joe,I can't help but feel some of that "no offense and I hate to be harsh, but--" is directed at me. It feels a bit insulting for you to imply that I'm just a lowly newb who can't speak English. I realize those statements were directed at those that commented on your resource, but I tend to side with them, since I've read your instructions and am still quite obviously confused. I just want to say that if your documentation is hard for people to figure out, or if your resource doesn't work as advertised for everyone, that is not the user's problem. That's your problem. Don't try to pass the buck off to the users and call them stupid at the same time. After all, if they're so stupid, how on earth are they going to figure out how to fix the problem themselves?
I'm willing to admit when I'm wrong or if I make a mistake. But your instructions fail me from the very beginning, during the INSTALLATION step. That doesn't instill in me a great amount of faith in the rest of your directions.
So let's see how stupid I am:
1) If I understand you correctly, if my project name is Universe, the files should go in Universe/resources/font_boy/ ? That's what I did and the F didn't show up.
Screenshot of the Directory structure
Screenshot of FontBoy with no Icon in Editor
3) I understand what an image editor is and what some of the more widely used applications are. But what sort of editing needs to be done to the images after I open them in GIMP or Photoshop? In what ways am I supposed to edit the image that Font Boy generates for me? In other words, is there a reason why I would need to edit the image or should it work how it is when Font Boy creates it?
#7
Apparently it was looking for the image in the game/data folder, or something relative to that, damnit I'm still setting up my new computer so I can't double check anything '-)
Anyway, that specific issue is probably due to a recent TGB change in the common scripts associated with resource loading.
I can't help with the other issue though.
08/02/2008 (2:09 am)
Hmm I was messing around with the AudioManager resource the other day with 1.7.3. It also added a button to the editor around that area and it was also showing up blank. Apparently it was looking for the image in the game/data folder, or something relative to that, damnit I'm still setting up my new computer so I can't double check anything '-)
Anyway, that specific issue is probably due to a recent TGB change in the common scripts associated with resource loading.
I can't help with the other issue though.
#8
If you are new to TGB, maybe making custom fonts is too advanced for you. That's not an insult, you should be honest with yourself and your abilities. Go through the tutorials and crawl before you can walk, as they say. Sorry but no, I don't have a problem if you or others can't figure out my tool. The code is under 200 lines and under 10 functions. It works great for me and I use it extensively in my RPG project.
As far as editing goes when I edit the font images I tend to add filter effects like shadows, add/adjust colors, etc. Be sure to keep the letters in their places and try some edge detection filters. Adjust hue/saturation to your liking.
I don't know why the image isn't showing up for you, but in my project (named "RPG") I have the files in my "tgb\games\RPG\resources\font_boy" and the icon shows up fine. You may need to move your "Universe" folder to the "games" folder, where your "games" probably should be anyway if you follow the directory structure of the installation (where all demos/games sit in the "games" folder).
08/02/2008 (7:59 am)
Deozaan I did not call you stupid. I'm sorry if you are lacking confidence in your skills but you obviously missed one of the few simple steps in the instructions. If you have trouble copying files, clicking"ok" buttons or selecting things from dropdown menus there is little hope for you in this field. Also how can you explain the fact that it works for some people and doesn't work for others, most of whom are obviously new to TGB? If you are new to TGB, maybe making custom fonts is too advanced for you. That's not an insult, you should be honest with yourself and your abilities. Go through the tutorials and crawl before you can walk, as they say. Sorry but no, I don't have a problem if you or others can't figure out my tool. The code is under 200 lines and under 10 functions. It works great for me and I use it extensively in my RPG project.
As far as editing goes when I edit the font images I tend to add filter effects like shadows, add/adjust colors, etc. Be sure to keep the letters in their places and try some edge detection filters. Adjust hue/saturation to your liking.
I don't know why the image isn't showing up for you, but in my project (named "RPG") I have the files in my "tgb\games\RPG\resources\font_boy" and the icon shows up fine. You may need to move your "Universe" folder to the "games" folder, where your "games" probably should be anyway if you follow the directory structure of the installation (where all demos/games sit in the "games" folder).
#9
I tried to provide some helpful feedback about your resource and all you can do is insult my intelligence and say it's not your problem? Don't even try to tell me that you're not calling me stupid when you imply I'm unable to copy files, click OK buttons, or select things from a dropdown menu. I've shown you screenshots to prove that I've followed your instructions.
Any programmer worth his salt knows that bugs happen, and that just because it works on the programmer's system doesn't mean it works everywhere else.
I will never use, buy, or support your products because of the way you have treated me. I hope that when you finish your game you can manage to show more respect to people who will undoubtedly e-mail you for support.
08/02/2008 (3:30 pm)
Joe:I tried to provide some helpful feedback about your resource and all you can do is insult my intelligence and say it's not your problem? Don't even try to tell me that you're not calling me stupid when you imply I'm unable to copy files, click OK buttons, or select things from a dropdown menu. I've shown you screenshots to prove that I've followed your instructions.
Any programmer worth his salt knows that bugs happen, and that just because it works on the programmer's system doesn't mean it works everywhere else.
I will never use, buy, or support your products because of the way you have treated me. I hope that when you finish your game you can manage to show more respect to people who will undoubtedly e-mail you for support.
#10
Like I said, your directory structure is not what TGB expects. So it's possible that none of your resources will be able to load their graphics. This is not my fault, you should try to follow the standards with this engine or you will likely run into more issues like this. Move the game to your "games" folder and it will probably load the icon fine.
In any case... I'm not particularly fond of trolls or flamewars so I'm going to end my part of this conversation here. If you don't like it, can't use it, can't improve it, don't use it.
08/02/2008 (7:19 pm)
Sir please. I released a free snippet of my in house code. I don't get paid when you download or use it. I put it up here because it's better than nothing, which is what people get right now as far as font tools for Torque. Like I said, your directory structure is not what TGB expects. So it's possible that none of your resources will be able to load their graphics. This is not my fault, you should try to follow the standards with this engine or you will likely run into more issues like this. Move the game to your "games" folder and it will probably load the icon fine.
In any case... I'm not particularly fond of trolls or flamewars so I'm going to end my part of this conversation here. If you don't like it, can't use it, can't improve it, don't use it.
Torque Owner WesTT
Here
I used the same technique briefly before we switched projects to output dialogue.