News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: [PS2] Opening & Editing a Japanese .FNT file (Growlanser 6)  (Read 1745 times)

Risae

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
[PS2] Opening & Editing a Japanese .FNT file (Growlanser 6)
« on: March 16, 2019, 08:10:28 am »
Dear community,

i am currently in the process of translating the PS2 game Growlanser 6 from japanese to english with the help of somebody else.
With the help of abw i managed to dump all of the text using "Cartoprapher" and re-inserting it with "Atlas".
Now i would like to change the text font in Growlanser 6.

This is how the font looks like GL6:



This is how it looks like in Growlanser 5:



I managed to find these files in the GL6_DATA Folder:

GL6_FILE.DAT

Code: [Select]
0000002a.fnt
0000002b.fnt
0000002c.fnt
0000002d.fnt
0000002e.fnt
0000002f.fnt
00000030.fnt

After trying all the different files i found the font is stored in the file "0000002e.fnt".
Replacing the GL6 .FNT file with the GL5 one changes the Font correctly to the GL5 one, but there are strange spaces now:



Replacing all .FNT with the GL5 ones doesn't remove the strange spaces in the new font.

I tried various "Tile-Viewers", like TileMolester 0.19, TiledGGD and crystaltile2.
No matter which settings i use on these programs, i cannot display the font at all:



Does anybody have a clue what i could do to succesfuly edit the font?
« Last Edit: March 17, 2019, 01:48:31 pm by Risae »

Jorpho

  • Hero Member
  • *****
  • Posts: 4720
  • The cat screams with the voice of a man.
    • View Profile
Re: [PS2] Opening & Editing a Japanese .FNT file (Growlanser 6)
« Reply #1 on: March 18, 2019, 01:14:38 am »
These appear to be variable-width fonts.  If I'm not mistaken, that means that somewhere there's a table that stores the expected width of each character.

Much has been written on the subject of VWFs.  This might be useful:
http://mother3.fobby.net/blog/2008/03/29/welcome-to-text-welding-102/
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

Risae

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [PS2] Opening & Editing a Japanese .FNT file (Growlanser 6)
« Reply #2 on: March 18, 2019, 09:47:05 am »
Dear Jorpho,

thank you very much for your reply.

This is the first time i read about "VWF"s, thank you very much for the link.
I will update this thread once i know more.

Risae

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [PS2] Opening & Editing a Japanese .FNT file (Growlanser 6)
« Reply #3 on: March 31, 2020, 07:57:35 am »
I hope i am not breaking any rules by updating my own thread, but i made a little bit progress recently and i wanted to share that:

I believe the localization team of Growlanser 5 had to program a new function that allows the usage of VWFs.
In GL5 the developers didn't need a VWF, since everything was fixed width because of Japanese.
The translation team added

- a new Latin Alphabet font
- VWF code that supports the new font

Since Growlanser 5 and 6 use the exact same engine with next to no changes to it, i could just copy and paste the GL5 font into GL6.
But i believe that the original developers didn't copy the VWF from the english release of GL5 into GL6, because that would explain why the text didn't properly display ingame.

I was actually able to finally get the .FNT files to display correctly-ish in Tile Molester Mod using the following settings:

Code: [Select]
###### 2bpp ######

Settings JPN:

Codec: 2bpp linear, reverse order
Mode: 2 dimensional
Stretch: Columns 48, Rows 54


Settings ENG:

Codec: 2bpp linear, reverse order
Mode: 2 dimensional
Stretch: Columns 64, Rows 118


###### 4bpp ######

Settings JPN:

Codec: 4bpp linear, reverse order
Mode: 2 dimensional
Stretch: Columns 24, Rows 42


Settings ENG:

Codec: 4bpp linear, reverse order
Mode: 2 dimensional
Stretch: Columns 32, Rows 80

The result is this:

2bpp:

Spoiler:


4bpp:

Spoiler:


Risae

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: [PS2] Opening & Editing a Japanese .FNT file (Growlanser 6)
« Reply #4 on: April 07, 2020, 08:36:29 am »
I have new information on the font files and i would like to share them here:

A few days ago i saw that a new Tile Editor is in developement:

https://www.romhacking.net/forum/index.php?topic=30404.0

I tried it out and saw that just like Tile Molester Mod it was able to display my font files broken-ly.
So i asked the developer if he could take a look at the font files and he managed to find out a lot about them:

Quote
Hi Risae,

So I've looked at the GL5 files (GL6 looks the same) and the verdict is: "No, but kind of" regarding what I think is accurate viewing. I'm not sure how I would test accurate editing.

Here's the result so far: https://i.imgur.com/VTrS8OJ.png

I'll go through the steps necessary to get to the result for "GL5 ENG 0000002e.fnt".

The offset at 0x8 of each font file contains the location of the palette (0x220). Scroll here and see that the palette is split between two sections. TileShop cannot support scattered palettes at the moment, so I copy/pasted the second half directly after the first half. The color format is RGBA32 and not BGR15 as I would have assumed. I also changed the alpha channel values from 0x80 to 0xFF. 0x80 is probably a game/format-specific transparency value that maps onto an alpha blend mode that is not 50% transparent.

I mostly setup the included project through hand-editing the XML project files. Copy/pasting from single layout images is currently far from ideal and I've found some bugs in the process.

If you try the project, make sure the project file (and included modified font) is in the root of the TileShop folder. I introduced a bug with directory-dependency of the schema validation in the current version.

- Klarth

Here is the mentioned .xml file:

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<gdf version="0.8">
<project name="Growlanser">
<arranger name="GL5 ENG 0000002e" elementsx="1" elementsy="1" width="256" height="288" layout="single" color="indexed" defaultcodec="PSX 4bpp" defaultdatafile="/Growlanser/GL5 ENG 0000002e.fnt">
<element fileoffset="620" posx="0" posy="0" palette="/Growlanser/GL5 ENG 0000002e.CLUT.0" />
</arranger>
<palette name="GL5 ENG 0000002e.CLUT.0" fileoffset="220" datafile="/Growlanser/GL5 ENG 0000002e.fnt" color="RGBA32" entries="16" zeroindextransparent="false" />
<datafile name="GL5 ENG 0000002e.fnt" location="GL5 ENG 0000002e.fnt" />
</project>
</gdf>

With that i was able to see the font file pitch-perfect:

Spoiler:

After that i tried to create an .xml for the GL6 font, which is a bit different, but i couldn't get it working.
Klarth was able to help me out there too:

Quote
Hi Risae,

For the GL6 font provided, please know that getting the width correct is critically important. You cannot reuse the same width (and height) from other files. Luckily, the FNT file contains the width, height, palette offset, image data offset, etc as follows:

0x8 - Palette offset (probably 4-byte)
0xC - Image offset (probably 4-byte)
0x1A - Image width (2-bytes)
0x1C - Image height (2-bytes)

I have included a revision to the GL6 project which includes one arranger at an incorrect height (768) and the other at a correct height (192). Without header information, you would need to open the font file directly in TileShop, change codecs, adjust width/height/file offset until you figure out the correct settings.

For editing via TileShop:
Importing is currently not supported, but will be supported soon. Importing has worked for quite some time in ImageMagitekConsole, but I would like to have a nicer solution for merging multi-palette images before rolling it into TileShop. I may not hold back for that though.

There is a save button in the pixel editor's toolbar that saves changes directly to the file.

I would suggest holding your editing for now, at least if you plan on using TileShop. I have an undo/redo feature for the pixel editor locally, but probably won't release a new version for another 2-3 days. You may also want to wait for importing as hand-editing a font with transparency aliasing using a very basic pixel editor is not a fun task.

- Klarth

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<gdf version="0.8">
<project name="Growlanser">
<arranger name="GL6 JPN 0000002e 768" elementsx="1" elementsy="1" width="768" height="80" layout="single" color="indexed" defaultcodec="PSX 4bpp" defaultdatafile="/Growlanser/GL6 JPN 0000002e.fnt">
<element fileoffset="620" posx="0" posy="0" palette="/Growlanser/GL6 JPN 0000002e.CLUT.0" />
</arranger>
<arranger name="GL6 JPN 0000002e 192" elementsx="1" elementsy="1" width="192" height="320" layout="single" color="indexed" defaultcodec="PSX 4bpp" defaultdatafile="/Growlanser/GL6 JPN 0000002e.fnt">
<element fileoffset="620" posx="0" posy="0" palette="/Growlanser/GL6 JPN 0000002e.CLUT.0" />
</arranger>
<palette name="GL6 JPN 0000002e.CLUT.0" fileoffset="220" datafile="/Growlanser/GL6 JPN 0000002e.fnt" color="RGBA32" entries="16" zeroindextransparent="false" />
<datafile name="GL6 JPN 0000002e.fnt" location="GL6 JPN 0000002e.fnt" />
</project>
</gdf>

And here is how it looks like in TileShop:

Spoiler: