Race Fonts (*.fnt files)

Race Fonts (*.fnt files); support/discussion/questions

Moderator: thunderchero

User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
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)

Post by thunderchero »

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.

Image

Confirm delete and ignore warning about change of file size.

Step 2

Save your edited file , but with a TGA file extension!

Image

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.

Image

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

Image

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.

Image

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.

Image

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.
User avatar
Axis
Commander
Commander
Posts: 489
Joined: Sun Aug 16, 2015 8:28 am
Location: Finland
Contact:

Re: Race Fonts (*.fnt files)

Post by Axis »

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.
Impress the Empress.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
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)

Post by thunderchero »

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.
yes it is possible, but not easy.

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
tga.jpg
tga.jpg (101.77 KiB) Viewed 11210 times
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
User avatar
Axis
Commander
Commander
Posts: 489
Joined: Sun Aug 16, 2015 8:28 am
Location: Finland
Contact:

Re: Race Fonts (*.fnt files)

Post by Axis »

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.
Impress the Empress.
User avatar
Axis
Commander
Commander
Posts: 489
Joined: Sun Aug 16, 2015 8:28 am
Location: Finland
Contact:

Re: Race Fonts (*.fnt files)

Post by Axis »

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.
Impress the Empress.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
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)

Post by thunderchero »

Axis 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.
1. tga must be saved as 16 bit tga
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
User avatar
Axis
Commander
Commander
Posts: 489
Joined: Sun Aug 16, 2015 8:28 am
Location: Finland
Contact:

Re: Race Fonts (*.fnt files)

Post by Axis »

1. done right.
2. done right too.
3. haven't tried.
4. underway.
5. and here comes the problem :
Fontshex.jpg
Fontshex.jpg (556.04 KiB) Viewed 11200 times
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 :
Letterwidths.jpg
Letterwidths.jpg (401.86 KiB) Viewed 11200 times
Impress the Empress.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
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)

Post by thunderchero »

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.
file structure is everything. :wink:

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. :grin:
User avatar
Axis
Commander
Commander
Posts: 489
Joined: Sun Aug 16, 2015 8:28 am
Location: Finland
Contact:

Re: Race Fonts (*.fnt files)

Post by Axis »

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) :
Techscreen 1920 x 1080.jpg
Techscreen 1920 x 1080.jpg (594.8 KiB) Viewed 11141 times
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.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
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)

Post by thunderchero »

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
before.jpg
before.jpg (497.17 KiB) Viewed 11023 times
after.jpg
after.jpg (500.09 KiB) Viewed 11023 times
User avatar
Benman2785
Lieutenant-Commander
Lieutenant-Commander
Posts: 224
Joined: Fri Mar 20, 2009 2:00 am

Re: Race Fonts (*.fnt files)

Post by Benman2785 »

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 ;)
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
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)

Post by thunderchero »

I did these back in 2016 and don't know if they even work
12.zip
(5.22 KiB) Downloaded 45 times
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)
User avatar
Benman2785
Lieutenant-Commander
Lieutenant-Commander
Posts: 224
Joined: Fri Mar 20, 2009 2:00 am

Re: Race Fonts (*.fnt files)

Post by Benman2785 »

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
Screenshot 2023-04-14 233727.png (35.77 KiB) Viewed 2660 times
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7849
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)

Post by thunderchero »

Benman2785 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
funny thing is if you add them manually and edit wdf manually they work
121.jpg
121.jpg (223.46 KiB) Viewed 2648 times
Not sure what offset UE is flagging
User avatar
Benman2785
Lieutenant-Commander
Lieutenant-Commander
Posts: 224
Joined: Fri Mar 20, 2009 2:00 am

Re: Race Fonts (*.fnt files)

Post by Benman2785 »

here is a working humans12.fnt

HERE working 12px fonts
Last edited by Benman2785 on Mon Jul 31, 2023 3:49 pm, edited 2 times in total.
Post Reply

Return to “Race Fonts (*.fnt files)”