Kingdom Hearts 3 font

How to translate the files of a game
yusuf2020
Posts: 106
Joined: Wed Jun 17, 2020 1:12 pm

Kingdom Hearts 3 font

Post by yusuf2020 »

I'm localizing Kingdom Hearts 3 but there is font problem.Can these be modified?
yusuf2020
Posts: 106
Joined: Wed Jun 17, 2020 1:12 pm

Re: Kingdom Hearts 3 font

Post by yusuf2020 »

Up
LinkOFF
Posts: 88
Joined: Thu Aug 11, 2016 6:52 pm

Re: Kingdom Hearts 3 font

Post by LinkOFF »

I found the fonts in TresFont.uexp. It contains SWF file with 4 fonts with unknown format (.dat files in zip). Each of that files contains header+data+table. My investigation of .dat structure:

Code: Select all

short magic; //always 0x7FFB
int fileSize; //without first 6 bytes (magic+filesize)
short fontNum; //order of font in swf
string fontName; //has variable size
int unknown05; //always 0x00060000
byte unknown06; //?
short unknown07; //?
int unknown08; //width?
int unknown09; //height?
int dataLength; //size of font texture (tga?)


Archive - https://disk.yandex.ru/d/y099O5B2uD37Xw
yusuf2020
Posts: 106
Joined: Wed Jun 17, 2020 1:12 pm

Re: Kingdom Hearts 3 font

Post by yusuf2020 »

Code: Select all

/TresGame/Flash/91_font/TresFont.swf

It's extension is "swf"
If i know correctly, if we can extract this and repack this "TresFont.uexp"
JPEX Flash decompiler can help.
LinkOFF
Posts: 88
Joined: Thu Aug 11, 2016 6:52 pm

Re: Kingdom Hearts 3 font

Post by LinkOFF »

yusuf2020 wrote:

Code: Select all

/TresGame/Flash/91_font/TresFont.swf

It's extension is "swf"
If i know correctly, if we can extract this and repack this "TresFont.uexp"
JPEX Flash decompiler can help.

SWF contains 4 unknown files. I guess this is TGA textures, but i can't bring them to correct look(maybe because it swizzled). I showed the structure of these files above.
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Kingdom Hearts 3 font

Post by h3x3r »

LinkOFF wrote:I found the fonts in TresFont.uexp. It contains SWF file with 4 fonts with unknown format (.dat files in zip). Each of that files contains header+data+table. My investigation of .dat structure:

Code: Select all

short magic; //always 0x7FFB
int fileSize; //without first 6 bytes (magic+filesize)
short fontNum; //order of font in swf
string fontName; //has variable size
int unknown05; //always 0x00060000
byte unknown06; //?
short unknown07; //?
int unknown08; //width?
int unknown09; //height?
int dataLength; //size of font texture (tga?)


Archive - https://disk.yandex.ru/d/y099O5B2uD37Xw


Hh nice guesswork but that file is actual SWF. Just cut first 289 bytes from TresFont.uexp and save as swf. There are also some of data on the end of file but its few bytes. Just save that cutted file with JPEXS and compare with original. It will show you which bytes are removed after saving.
Image

Here is 010 Hex Editor template to parse not whole file but at least the SWF you wanted.

Code: Select all

//------------------------------------------------
//--- 010 Editor v11.0.1 Binary Template
//
//      File:
//   Authors:
//   Version:
//   Purpose:
//  Category:
// File Mask:
//  ID Bytes:
//   History:
//------------------------------------------------
LittleEndian();
FSeek(285);

struct {
    uint GFXFileSizeCheckFlag;
    ubyte GFXFile[GFXFileSizeCheckFlag];
    uint ExtraDataSize;
    ubyte ExtraData[ExtraDataSize];
} GFXF;
yusuf2020
Posts: 106
Joined: Wed Jun 17, 2020 1:12 pm

Re: Kingdom Hearts 3 font

Post by yusuf2020 »

LinkOFF wrote:I found the fonts in TresFont.uexp. It contains SWF file with 4 fonts with unknown format (.dat files in zip). Each of that files contains header+data+table. My investigation of .dat structure:

Code: Select all

short magic; //always 0x7FFB
int fileSize; //without first 6 bytes (magic+filesize)
short fontNum; //order of font in swf
string fontName; //has variable size
int unknown05; //always 0x00060000
byte unknown06; //?
short unknown07; //?
int unknown08; //width?
int unknown09; //height?
int dataLength; //size of font texture (tga?)


Archive - https://disk.yandex.ru/d/y099O5B2uD37Xw

Image
How did you export the TresTestDebugFontLarge.uexp ?
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Kingdom Hearts 3 font

Post by h3x3r »

Most probably with Umodel. Set engine version from 4.16 to 4.19 but you get nothing useable... BTW textures are PS4 swizzled. I manage to HEX extract first texture from 112 or so.
LinkOFF
Posts: 88
Joined: Thu Aug 11, 2016 6:52 pm

Re: Kingdom Hearts 3 font

Post by LinkOFF »

h3x3r, thanks!
yusuf2020 wrote:How did you export the TresTestDebugFontLarge.uexp ?

Gildor's Umodel
yusuf2020
Posts: 106
Joined: Wed Jun 17, 2020 1:12 pm

Re: Kingdom Hearts 3 font

Post by yusuf2020 »

I got these files with viewtopic.php?f=9&t=12764&hilit=uasset+script
Does it help ?
I can also repack it.I guess there is a compression.