bft font image
-
herbert3000
- veteran
- Posts: 134
- Joined: Wed Jun 02, 2010 4:53 am
- Has thanked: 18 times
- Been thanked: 143 times
- Contact:
Re: bft font image
Here's what I found out about the file format:
Code: Select all
// main_font_sdw_vita.unpack
byte header[12]; // it's the same in both .unpack files
int characterCount;
struct charInfo {
short keycode;
byte zero; // always zero
byte xOffset; // not sure about the offsets
byte yOffset;
byte horOffset;
byte charWidth;
byte charHeight;
int unknown; // initial value = 0x55800000, increases by 0x56 each line
};
// @0x1525C
struct charData {
byte charBitmap[19 * 36];
int unknown; // alwys zero? padding?
};
// @0x4D160C
// don't know what that section is
int unknownCount;
struct unknown {
short;
short;
int;
};- shakotay2
- MEGAVETERAN

- Posts: 3461
- Joined: Fri Apr 20, 2012 9:24 am
- Location: Nexus, searching for Jim Kirk
- Has thanked: 955 times
- Been thanked: 1876 times
Re: bft font image
texturefinder reveals more about main_font.unpack:
You do not have the required permissions to view the files attached to this post.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."
-
herbert3000
- veteran
- Posts: 134
- Joined: Wed Jun 02, 2010 4:53 am
- Has thanked: 18 times
- Been thanked: 143 times
- Contact:
Re: bft font image
The font characters are simple 8-bit grayscale bitmaps with a fixed size of 19x36 pixels per character.
Here's a screenshot of the characters in main_font.unpack, mapped onto a 1024 pixels wide texture atlas:
Here's a screenshot of the characters in main_font.unpack, mapped onto a 1024 pixels wide texture atlas:
You do not have the required permissions to view the files attached to this post.
-
adol365
- advanced
- Posts: 70
- Joined: Fri Nov 21, 2014 12:21 pm
- Has thanked: 17 times
- Been thanked: 7 times
Re: bft font image
Oh, did you open it as a raw file from Photoshop? Is there a specific height?herbert3000 wrote:The font characters are simple 8-bit grayscale bitmaps with a fixed size of 19x36 pixels per character.
Here's a screenshot of the characters in main_font.unpack, mapped onto a 1024 pixels wide texture atlas:
-
herbert3000
- veteran
- Posts: 134
- Joined: Wed Jun 02, 2010 4:53 am
- Has thanked: 18 times
- Been thanked: 143 times
- Contact:
Re: bft font image
Actually I wrote a simple java program that converts the font file into a raw image.adol365 wrote:Oh, did you open it as a raw file from Photoshop? Is there a specific height?
You do not have the required permissions to view the files attached to this post.
-
adol365
- advanced
- Posts: 70
- Joined: Fri Nov 21, 2014 12:21 pm
- Has thanked: 17 times
- Been thanked: 7 times
Re: bft font image
Uhm.. unfortunately I had never learned Java.herbert3000 wrote:Actually I wrote a simple java program that converts the font file into a raw image.adol365 wrote:Oh, did you open it as a raw file from Photoshop? Is there a specific height?
- Acewell
- VIP member

- Posts: 1329
- Joined: Wed Nov 05, 2008 12:16 pm
- Has thanked: 2683 times
- Been thanked: 841 times
Re: bft font image
just drop your samples in the folder with the fontToRaw java filesadol365 wrote:Uhm.. unfortunately I had never learned Java.
open a command prompt there and type
java fontToRaw
press Enter then it'll ask for a file name like this
Enter filename:
then you can type the name of your sample file and press Enter
and you will get a raw image file of that sample in that folder
that you can open in Photoshop with the dimensions in the file name
-
herbert3000
- veteran
- Posts: 134
- Joined: Wed Jun 02, 2010 4:53 am
- Has thanked: 18 times
- Been thanked: 143 times
- Contact:
Re: bft font image
@adol365: Just a quick question. At the current state the program outputs this data:
https://www.mediafire.com/?7acvohe2y3tcb79
Is this sufficient for you to edit the font? If yes, I could start to write the repacker.
https://www.mediafire.com/?7acvohe2y3tcb79
Is this sufficient for you to edit the font? If yes, I could start to write the repacker.
-
adol365
- advanced
- Posts: 70
- Joined: Fri Nov 21, 2014 12:21 pm
- Has thanked: 17 times
- Been thanked: 7 times
Re: bft font image
Yes, it is sufficient for me. By the way, is horOffset means xadvance?herbert3000 wrote:@adol365: Just a quick question. At the current state the program outputs this data:
https://www.mediafire.com/?7acvohe2y3tcb79
Is this sufficient for you to edit the font? If yes, I could start to write the repacker.
-
herbert3000
- veteran
- Posts: 134
- Joined: Wed Jun 02, 2010 4:53 am
- Has thanked: 18 times
- Been thanked: 143 times
- Contact:
Re: bft font image
I pretty sure I mixed up the offsets (x/y/hor).
The value that is currently named horOffset is high for characters like "." and "," so I think that's the actual y-offset, is that possible?
The value that is currently named horOffset is high for characters like "." and "," so I think that's the actual y-offset, is that possible?
-
adol365
- advanced
- Posts: 70
- Joined: Fri Nov 21, 2014 12:21 pm
- Has thanked: 17 times
- Been thanked: 7 times
Re: bft font image
But isn't you already declare yoffset before horOffset?herbert3000 wrote:I pretty sure I mixed up the offsets (x/y/hor).
The value that is currently named horOffset is high for characters like "." and "," so I think that's the actual y-offset, is that possible?
I'm not sure exactly what horOffset means but it doesn't quiet matter if one can make a new font.
-
herbert3000
- veteran
- Posts: 134
- Joined: Wed Jun 02, 2010 4:53 am
- Has thanked: 18 times
- Been thanked: 143 times
- Contact:
Re: bft font image
xOffset, yOffset and horOffset were my first guess for the last 3 values but I guess I was wrongadol365 wrote:But isn't you already declare yoffset before horOffset?
I'm not sure exactly what horOffset means but it doesn't quiet matter if one can make a new font.
If you figure out the true meaning, I can correct that in the program.
But you are right, for making a new font, the names of the keywords are irrelevant.
I should have named them unknown1, unknown2 and unknown3
-
adol365
- advanced
- Posts: 70
- Joined: Fri Nov 21, 2014 12:21 pm
- Has thanked: 17 times
- Been thanked: 7 times
Re: bft font image
In my opinion, the easy way to confirm what is the meaning of UNK1, 2, 3 is that modify fnt table data and take a test in the game.herbert3000 wrote:xOffset, yOffset and horOffset were my first guess for the last 3 values but I guess I was wrongadol365 wrote:But isn't you already declare yoffset before horOffset?
I'm not sure exactly what horOffset means but it doesn't quiet matter if one can make a new font.
If you figure out the true meaning, I can correct that in the program.
But you are right, for making a new font, the names of the keywords are irrelevant.
I should have named them unknown1, unknown2 and unknown3
-
herbert3000
- veteran
- Posts: 134
- Joined: Wed Jun 02, 2010 4:53 am
- Has thanked: 18 times
- Been thanked: 143 times
- Contact:
Re: bft font image
Here's a converter for the file main_font.unpack:
Usage: Run the .bat file,
to unpack the file enter: main_font.unpack
to repack the file enter: main_font.unpack.txt
Backup your original files because this tool will overwrite existing files without confirmation.
to unpack the file enter: main_font.unpack
to repack the file enter: main_font.unpack.txt
Backup your original files because this tool will overwrite existing files without confirmation.
You do not have the required permissions to view the files attached to this post.

