Race Fonts (*.fnt files)
Moderator: thunderchero
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Race Fonts (*.fnt files)
Here is a great post by pigman
Hi anyone interested in using new fonts within BOTF
May have cracked this one.
Each empire has 4 font files, but the 9 pt font can be ignored as it contains race colour and is used on map screen (unless you want to change colour, that is). Sadly, can't change colour on the larger fonts, (I think 15 pt, 20 pt and 28 pt) as these are just grey and colour is added elsewhere within BOTF.
=> changing colors of race fonts / map-grids
Thought I'd do a little tutorial on this now that I've had success.
I have assumed that you will be able to use Winrar or similar to extract font files from stbof.res and after editing can then return them to same.
Have also assumed you can use a hex editor and a suitable graphics package to edit TGA graphics files.
Step 1
Having already extracted the fonts (all have file extension .FNT), you will need to open the font that you want to edit with your hex editor. Having done that you highlight the bytes that need removing from the file in order to be able to edit it in a graphics package.
Confirm delete and ignore warning about change of file size.
Step 2
Save your edited file , but with a TGA file extension!
Your original FNT file will be unchanged.
Step 3
Now you can edit the file in a graphics package. I'm using Photoshop Elements 2.0 as it can save TGA files in 16 bit.
You can now select a font from the text input part of your graphics package and can type onto the free black area of the graphics file.
I believe that the brightness of the characters is then reflected into the way BOTF displays the fonts, so I set the colour to grey at 90 % brightness. You can experiment as you wish. You can also try using colours. I haven't tried this yet as BOTF colours the fonts anyway, in the game and may just override your colours, or even crash the game.
Step 4
You can the cut and paste your new characters into their corresponding slots. Be careful not to overlap any of the outline/grid. The fun will be finding narrow enough fonts to fit in the spaces and you can't change the width of the boxes...I've tried!
You then save this file as a 16 bit TGA file (BOTF doesn't like TGAs of any other bit depth).
Step 5
Now some more hex editing. You need to put back the bytes removed in the first step.
Open both the original FNT file in your hex editor and the TGA file in same editor. You need to copy the bytes removed originally, from the FNT file, and then paste insert them back into the beginning of your edited TGA file.
Now save with the original font name and make sure you change extension to FNT.
You will now have a new font that you can Winrar back into stbof.res and away you go.
Here is the result using Aurora Bold Condensed on my new Gorn interface.
Hope this is useful to all you modders out there.
Regards
Pigman
Hi anyone interested in using new fonts within BOTF
May have cracked this one.
Each empire has 4 font files, but the 9 pt font can be ignored as it contains race colour and is used on map screen (unless you want to change colour, that is). Sadly, can't change colour on the larger fonts, (I think 15 pt, 20 pt and 28 pt) as these are just grey and colour is added elsewhere within BOTF.
=> changing colors of race fonts / map-grids
Thought I'd do a little tutorial on this now that I've had success.
I have assumed that you will be able to use Winrar or similar to extract font files from stbof.res and after editing can then return them to same.
Have also assumed you can use a hex editor and a suitable graphics package to edit TGA graphics files.
Step 1
Having already extracted the fonts (all have file extension .FNT), you will need to open the font that you want to edit with your hex editor. Having done that you highlight the bytes that need removing from the file in order to be able to edit it in a graphics package.
Confirm delete and ignore warning about change of file size.
Step 2
Save your edited file , but with a TGA file extension!
Your original FNT file will be unchanged.
Step 3
Now you can edit the file in a graphics package. I'm using Photoshop Elements 2.0 as it can save TGA files in 16 bit.
You can now select a font from the text input part of your graphics package and can type onto the free black area of the graphics file.
I believe that the brightness of the characters is then reflected into the way BOTF displays the fonts, so I set the colour to grey at 90 % brightness. You can experiment as you wish. You can also try using colours. I haven't tried this yet as BOTF colours the fonts anyway, in the game and may just override your colours, or even crash the game.
Step 4
You can the cut and paste your new characters into their corresponding slots. Be careful not to overlap any of the outline/grid. The fun will be finding narrow enough fonts to fit in the spaces and you can't change the width of the boxes...I've tried!
You then save this file as a 16 bit TGA file (BOTF doesn't like TGAs of any other bit depth).
Step 5
Now some more hex editing. You need to put back the bytes removed in the first step.
Open both the original FNT file in your hex editor and the TGA file in same editor. You need to copy the bytes removed originally, from the FNT file, and then paste insert them back into the beginning of your edited TGA file.
Now save with the original font name and make sure you change extension to FNT.
You will now have a new font that you can Winrar back into stbof.res and away you go.
Here is the result using Aurora Bold Condensed on my new Gorn interface.
Hope this is useful to all you modders out there.
Regards
Pigman
Last edited by thunderchero on Sat Feb 13, 2010 9:15 pm, edited 1 time in total.
Re: Race Fonts (*.fnt files)
Is it possible to increase the size of fonts?
Like : 15 to 20, 20 to 25 and 28 to 30 or something?
15 to 20 is quite simple, just rename the fonts.
Like : 15 to 20, 20 to 25 and 28 to 30 or something?
15 to 20 is quite simple, just rename the fonts.
Impress the Empress.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Race Fonts (*.fnt files)
yes it is possible, but not easy.Axis wrote:Is it possible to increase the size of fonts?
Like : 15 to 20, 20 to 25 and 28 to 30 or something?
15 to 20 is quite simple, just rename the fonts.
I have never attempted it though.
from what I understand the basic steps would be...
1. make new 16bit tga that is formatted like this image just larger
2. next the fun part hex editing location index, the index is the first 108 bytes
not sure the format but it has
number of entries
height and width of full tga
then for each entry has height and width of entries, and location of each entry
then you would need to hex add the location index back to new tga file and save as .fnt
exact format of index is very important or you will get misalignment or wrong letter used
next problem is using new file mostly this is editing wdf files, but some are also called by trek.exe
Re: Race Fonts (*.fnt files)
OK.
Sounds quite difficult.
I already started an easier way, I just made those *28's fonts higher (up to max height), and now I'm resizing the *20's fonts in the *28's slots, and renaming it to *20.fnt.
So, I'll have what I wanted.
Sounds quite difficult.
I already started an easier way, I just made those *28's fonts higher (up to max height), and now I'm resizing the *20's fonts in the *28's slots, and renaming it to *20.fnt.
So, I'll have what I wanted.
Impress the Empress.
Re: Race Fonts (*.fnt files)
So...
It wasn't as easy as I thought, after adding the normal letters (not the capitals), the UE complained about "invalid image" and the game didn't respond.
Could it be possible to somehow combine the data from *20.fnt and *28.fnt, so you could have all the letters?
I think it might be half easy/difficult.
It wasn't as easy as I thought, after adding the normal letters (not the capitals), the UE complained about "invalid image" and the game didn't respond.
Could it be possible to somehow combine the data from *20.fnt and *28.fnt, so you could have all the letters?
I think it might be half easy/difficult.
Impress the Empress.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Race Fonts (*.fnt files)
1. tga must be saved as 16 bit tgaAxis wrote:It wasn't as easy as I thought, after adding the normal letters (not the capitals), the UE complained about "invalid image" and the game didn't respond.
2. after editing tga you must add back header to tga file with hex editor (first 108 bytes)
3. headers can not be swapped between 20.fnt and 28.fnt
4. size of green boxes can not be changed with out hex editing header
Re: Race Fonts (*.fnt files)
1. done right.
2. done right too.
3. haven't tried.
4. underway.
5. and here comes the problem :
Those human15.fnt and human20.fnt are originals, and that human28.fnt is edited by me, with a new tga added.
I hope you see, (first row) at 0 seems to be the height of the font, then (at 2) comes something I don't understand, then at 4 is 0A (all fonts have it).
At 6 is the number of letterboxes (hex 78, or 120 decimal), 8 is width of the image (.tga), at A height. Then comes the second unknown value at C.
The rest is similar with the other files, until we come to the .tga file.
Here's the letterboxes widths too, 120 of them :
2. done right too.
3. haven't tried.
4. underway.
5. and here comes the problem :
Those human15.fnt and human20.fnt are originals, and that human28.fnt is edited by me, with a new tga added.
I hope you see, (first row) at 0 seems to be the height of the font, then (at 2) comes something I don't understand, then at 4 is 0A (all fonts have it).
At 6 is the number of letterboxes (hex 78, or 120 decimal), 8 is width of the image (.tga), at A height. Then comes the second unknown value at C.
The rest is similar with the other files, until we come to the .tga file.
Here's the letterboxes widths too, 120 of them :
Impress the Empress.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Race Fonts (*.fnt files)
file structure is everything.Axis wrote:(first row) at 0 seems to be the height of the font, then (at 2) comes something I don't understand, then at 4 is 0A (all fonts have it).
At 6 is the number of letterboxes (hex 78, or 120 decimal), 8 is width of the image (.tga), at A height. Then comes the second unknown value at C.
The rest is similar with the other files, until we come to the .tga file.
I took a quick look here is what I started
0x000000 29 start point down pixels of first box
0x000001 1 start point right pixels of first box (9.fnt set to 0?)
0x000002 773
or
0x000002 5
0x000003 3
0x000004 10
0x000006 120 total entries (green boxes)
0x000008 295 image width
0x00000a 146 image height
0x00000c 150
0x00000d 80
0x00000e 1
0x000010 1537
or
0x000010 1
0x000011 6
0x000012 86
0x000014 - 0x000109 table
0x000110 295 image width (this should change when tga is saved)
0x000112 146 image height (this should change when tga is saved)
you need to fill in the blanks, best way is trial and error.
Re: Race Fonts (*.fnt files)
OK.
I came to a conclusion that I'll use the original boxes and modify the fonzies based on them.
This is what I'd call 99% complete tech management screen (just "spit and polish", or sharpening of pixels) : Here you can see, I used *20.fnt as *15, then largened *20 as new *20, then made *28 higher.
Btw, if anyone wants to do the same, one must keep in mind, always leave one row of pixels black at the bottom of the fontboxes
(otherwise the game cuts the letters off by one pixelrow, heightening textboxes in .wdfs won't help).
I came to a conclusion that I'll use the original boxes and modify the fonzies based on them.
This is what I'd call 99% complete tech management screen (just "spit and polish", or sharpening of pixels) : Here you can see, I used *20.fnt as *15, then largened *20 as new *20, then made *28 higher.
Btw, if anyone wants to do the same, one must keep in mind, always leave one row of pixels black at the bottom of the fontboxes
(otherwise the game cuts the letters off by one pixelrow, heightening textboxes in .wdfs won't help).
Impress the Empress.
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Race Fonts (*.fnt files)
well it is possible to create new fnt files.
at least the 9 fnt, I did not make much of a change 9 to 12 for larger gui's it uses larger tga file and each text area is larger with edited original header.
note; file still use *9.tga so no trek changes
here is header info I came up with
0x000 height of font +1
0x001 1 (all others) or 0 (9 fnt)
0x002 - 0x003 260 start of tga file
0x004 - 0x005 10 (unknow/unchanged)
0x006 - 0x007 120 total blocks
0x008 - 0x009 width of tga
0x00a - 0x00b height of tga
0x00c - 0x00F 47354 tga sile size in bytes
0x010 - 0x011 1536 (unknow/unchanged)
0x012 - 0x013 86 (unknow/unchanged)
0x014 - start of row 1 (10 entries)
0x028 - start of row 2 (26 entries)
0x05c - start of row 3 (26 entries)
0x090 - start of row 4 (32 entries)
0x0d0 - start of row 5 (26 entries)
note; first entry of each row is font area width only, all others entries in that row are font area width +1
here is what changes looks like
at least the 9 fnt, I did not make much of a change 9 to 12 for larger gui's it uses larger tga file and each text area is larger with edited original header.
note; file still use *9.tga so no trek changes
here is header info I came up with
0x000 height of font +1
0x001 1 (all others) or 0 (9 fnt)
0x002 - 0x003 260 start of tga file
0x004 - 0x005 10 (unknow/unchanged)
0x006 - 0x007 120 total blocks
0x008 - 0x009 width of tga
0x00a - 0x00b height of tga
0x00c - 0x00F 47354 tga sile size in bytes
0x010 - 0x011 1536 (unknow/unchanged)
0x012 - 0x013 86 (unknow/unchanged)
0x014 - start of row 1 (10 entries)
0x028 - start of row 2 (26 entries)
0x05c - start of row 3 (26 entries)
0x090 - start of row 4 (32 entries)
0x0d0 - start of row 5 (26 entries)
note; first entry of each row is font area width only, all others entries in that row are font area width +1
here is what changes looks like
- Benman2785
- Lieutenant-Commander
- Posts: 224
- Joined: Fri Mar 20, 2009 2:00 am
Re: Race Fonts (*.fnt files)
mh - would love to have a *12 font for each race - as i could use longer ship names for german
yet i only get gibberish if i try to play with the header
EDIT: would even donate 20$ if someone could modify all the *15 into *12
yet i only get gibberish if i try to play with the header
EDIT: would even donate 20$ if someone could modify all the *15 into *12
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Race Fonts (*.fnt files)
I did these back in 2016 and don't know if they even work
each location you want to use them you must change the appropriate wdf file or correct location in trek.exe depending of change location desired.
that is if they even work
Note none of these have special race font (all 5 have same font)
each location you want to use them you must change the appropriate wdf file or correct location in trek.exe depending of change location desired.
that is if they even work
Note none of these have special race font (all 5 have same font)
- Benman2785
- Lieutenant-Commander
- Posts: 224
- Joined: Fri Mar 20, 2009 2:00 am
Re: Race Fonts (*.fnt files)
super thank you - will test them now
give me your "buymeacoffee" or paypal via personal message
EDIT: tested - they are not working ;/ - also when added they have no preview unlike the other fonts
give me your "buymeacoffee" or paypal via personal message
EDIT: tested - they are not working ;/ - also when added they have no preview unlike the other fonts
- thunderchero
- Site Administrator aka Fleet Admiral
- Posts: 7934
- Joined: Fri Apr 25, 2008 2:00 am
- Location: On a three month training mission, in command of the USS Valiant.
Re: Race Fonts (*.fnt files)
funny thing is if you add them manually and edit wdf manually they workBenman2785 wrote: ↑Fri Apr 14, 2023 5:33 pm super thank you - will test them now
give me your "buymeacoffee" or paypal via personal message
EDIT: tested - they are not working ;/ - also when added they have no preview unlike the other fonts
Screenshot 2023-04-14 233727.png
Not sure what offset UE is flagging
- Benman2785
- Lieutenant-Commander
- Posts: 224
- Joined: Fri Mar 20, 2009 2:00 am
Re: Race Fonts (*.fnt files)
Last edited by Benman2785 on Mon Jul 31, 2023 3:49 pm, edited 2 times in total.