Jump to content

Help to view/edit the font0.bin file of You-Gi-Oh Duel Monsters (PS2)


Go to solution Solved by Gil_Unx,

Recommended Posts

Posted

Hello everyone, someone can help me to view/export the attached file to a common format as the png? This file is the font (glyphs) of Yu-Gi-Oh Duel Monsters GX Tag Force Evolution (PS2 release). It seems this font is compressed, this game has others compressed files, there is some tools to edit the others files, but there's no tool to edit the font. Thanks in advance!

font0.rar

  • 2 weeks later...
Posted

I concur some variable length compression is likely, seeing patterns like this, making the compressed files part of this forum appropriate for that (these wavy artifacts are often indicative):

compressionlikely.png.ae60a3b935cd626077b6e3f6f5cda214.png

Though, I also see some uncompressed glyphs in the file, like Hiragana gu and ke:

hiraganagu.png.d7ab8e829609b0f8128dc7249b474609.png

hiraganake.png.9cdcf2a7cc13924a5e63cecd3804f63f.png

Some observations that may help you and/or others figure it out:

- 0..4468h - 8-byte records, presumably containing glyph offset, size, and format info

- 4468h..7AD0 - variable size glyphs probably compressed

- 7AD0..11BA4 - 4bpp uncompressed variable size glyphs

- 11BA4.. - variable size glyphs probably compressed

Posted

There is a tool to dump files EHP archives used by this game, many dumped files I can make the decompression using the WinRAR. I tried to attach a header used by zip format to try decompress this font, but the WinRAR says "The file is corrupted". Maybe the compression algorithm is Deflate.

  • 2 weeks later...
Posted
On 4/28/2025 at 12:42 AM, Alpha 1001 said:

Maybe the compression algorithm is Deflate.

Those might be informative then.

 

 

  • 2 weeks later...
  • Solution
Posted

I, together with AI, have created a tool to export/import PNGs from FONT0.bin.
The compression method is similar to LZ (though I'm not sure about the specifics).

Editing steps:

1. Export.

2. Edit the PNG — the edited PNG must be in indexed format.

3. Edit the JSON — it contains information such as width, height, left, and top. Adjust these to fit the new characters.

4. Save.

Note:

Try to make the edited font smaller than the original.
It seems the game allocates a fixed amount of memory for fonts.
Fortunately, the compression works correctly.
 

 

FONT0_0000.png

FONT0_Tool.zip

  • Like 2
Posted (edited)
On 19/05/2025 at 14:12, Gil_Unx said:

I, together with AI, have created a tool to export/import PNGs from FONT0.bin.
The compression method is similar to LZ (though I'm not sure about the specifics).

Editing steps:

1. Export.

2. Edit the PNG — the edited PNG must be in indexed format.

3. Edit the JSON — it contains information such as width, height, left, and top. Adjust these to fit the new characters.

4. Save.

Note:

Try to make the edited font smaller than the original.
It seems the game allocates a fixed amount of memory for fonts.
Fortunately, the compression works correctly.
 

 

FONT0_0000.png

FONT0_Tool.zip 320.4 kB · 9 downloads

Why does this error occur? I extract the textures, edit them, edit the json, but when I extract them again, the edited texture comes out like this.

font0_0000.png

Edited by Wesker Bad
Posted (edited)
On 5/21/2025 at 7:16 AM, Wesker Bad said:

Why does this error occur? I extract the textures, edit them, edit the json, but when I extract them again, the edited texture comes out like this.

font0_0000.png

 

 

"It seems to be from the palette. Try to keep the palette order intact. Use an application like GIMP so that the palette order stays the same as the original. Some image editing tools tend to change the palette colors using their own algorithms."

Edited by Gil_Unx
  • Like 1
Posted
14 hours ago, Gil_Unx said:

 

 

"It seems to be from the palette. Try to keep the palette order intact. Use an application like GIMP so that the palette order stays the same as the original. Some image editing tools tend to change the palette colors using their own algorithms."

Even using Gimp, it still gives the same error. I asked a friend of mine to try, and the same error happens to him, even though he is very skilled in editing PS2 game textures. Were you able to edit without any problems? If so, it must be done in a very specific way.

Posted
20 hours ago, Wesker Bad said:

Even using Gimp, it still gives the same error. I asked a friend of mine to try, and the same error happens to him, even though he is very skilled in editing PS2 game textures. Were you able to edit without any problems? If so, it must be done in a very specific way.

The tool you're using sorts the palette from the lowest value 000000FF = black to FFFFFFFF = white, but  default tool color order is from white to black. Use the second color type so it matches the tool you're using. Extract from a fresh font0.bin using FNT.exe -e 2, edit the PNG and JSON, import, and save. If possible, try not to change the color order, because font files usually use multiple palette colors.

Second color palette.

.FONT0_0000.png.e072569435068e7bb392460ed9c9c962.png

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...