|
Re: Changing .tga fonts [message #435024 is a reply to message #434981] |
Thu, 19 August 2010 01:54 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) |
![](http://renegadeforums.com/images/custom_avatars/20791.jpg) |
Spyder
Messages: 1070 Registered: March 2006
Karma: 0
|
General (1 Star) |
|
|
Nevermind about this one, solved it already.
Little explanation.
The .tga font files are actually rather straightforward. Let's say we have the file font8x8.tga
font8x8
This means that each letter/number/symbol in that image can take up a space of 8 by 8 pixels. Each tga font image is 16 rows high and 16 columns wide. So if we have the image font8x8 this image would be 16*8 high and 16*8 wide, which results in a 128x128 image.
Each row has 16 columns. This means that we can store 16 characters in each row. Westwood reads the font files in the following way.
![index.php/fa/12909/0/](index.php/fa/12909/0/)
As you can see, the two topmost rows are not used at all. I don't know what the white box is for, but I consider it non-existant.
On the third row, you see some widely used symbols. On the fourth row we have the numbers and some more symbols. And from row five to eight we have the uppercase and lowercase characters with some more symbols.
If you want to make your own custom .tga font file, just measure the width and height of the biggest character. Write it down on a piece of paper or remember it. Then grab a calculator and do the following:
width * 16 = width of document
height * 16 = height of document
Then create a new image file in i.e. Photoshop and draw some lines. So if your biggest character is 12px wide, you draw a line every 12 pixels. This would result in a line at: 0, 12, 24, 36, 48 etc.. The same goes for the height of the biggest character.
Then when you've set up your grid, start adding the characters, numbers and symbols that you want to use. Any unused characters can be left out.
When you've added every character you want, select them all, create a new alpha channel on the channels tab, and fill the characters with white (this makes them visible).
![index.php/fa/12910/0/](index.php/fa/12910/0/)
Once you're done, you save the new file as a 32bit .tga file WITH alpha channels.
You can now use your custom font file. I don't know what you can do with these files, except for using them with a HUD.ini file.
[Updated on: Sat, 10 September 2011 06:43] Report message to a moderator
|
|
|