Help porting PT-BR translation to Cave Story+

Nov 14, 2017 at 1:21 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Nov 14, 2017
Location:
Posts: 4
Age: 37
Hello guys.

My name is Leonardo and my nickname is Solid One. I'm a brazilian romhacker focused on translating games to brazilian portuguese.

Recently I discovered Cave Story, firstly on my raspberry and later on my Nintendo 3DS with Cave Story 3D. It's a great game, with interesting plot and nice gameplay mechanics. Particularly, I liked a lot its 2.5d counterpart that has debutted on 3DS, with great scenarios that makes a good use of stereoscopic 3D.

Anyway, me and other three guys decided to port PT-BR translation of Cave Story, made by Alex Foffano, to Cave Story 3D. Luckily, we were able to edit texts, graphics, and even the font has all needed accents, such as à, ã, ç, etc. It was a easy and fast job that we finished today, as you can see on the images below.

p361065-0-vul86jt.png
p361065-1-rod02lk.png


However, the same can't be said of Cave Story+. Although there's lots of tools for editing texts, graphics and creating mods, I couldn't find anything that allow me to insert other accents into CS font.

That's why I'm here to humbly ask: Can anyone help me editing CS+ font, to insert missing characters?
 
Nov 14, 2017 at 1:55 AM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
I think it's a custom bitmapped font, so yeah most likely it will not support
Have you tried umm, FontForge? https://fontforge.github.io/en-US/
alternately, just using a different font that has the supported characters.
 
Nov 14, 2017 at 2:02 AM
Neophyte Member
"Fresh from the Bakery"
Join Date: Nov 14, 2017
Location:
Posts: 4
Age: 37
I think it's a custom bitmapped font, so yeah most likely it will not support
Have you tried umm, FontForge? https://fontforge.github.io/en-US/
alternately, just using a different font that has the supported characters.

Unfortunately, Cave Story Plus makes use of another font mechanism.

I know that original Cave Story from 2004 uses a Windows TTF font for rendering texts (probably Courier New), and since that font has all accents, it works.

However, on CS+, the font seems to be divided in two files: csfont.fnt and csfont_00.bmp. I can find the characters on the second file (with a messy order), but it has no accents and no space to add new characters.

I readed this post on the forum that says csfont.fnt has coordinates relative to csfont_00.bmp, such as widths, heights and positions. But if someone know of an existing tool for editing CS+ font, I'd really appreciate it.
 
Nov 14, 2017 at 2:06 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Nov 14, 2017
Location:
Posts: 4
Age: 37
http://www.angelcode.com/products/bmfont/doc/file_format.html
it's just this
I imagine fontforge could edit a bmfont

Interesting. Thanks for the link above.

I found out that there's a software called BMFont on that link, and this software is able to convert TTF fonts to FNT + PNG. The syntax of the file is very similar to the original files.

Fiddling with BMFont, I was able to generate an almost identical image font. Here's the instructions:

== FONT SETTINGS ==

Font: Cave Story Plus (I've got this TTF font, and added accents with an font editor called Birdfont)
Font size: 22px
Font smoothing: disabled

== EXPORT OPTIONS ==

Width: 256 (ideally it should be 128, but it doesn't fit)
Height: 256 (ideally it should be 128, but it doesn't fit)
Font descriptor: Binary
Textures: TGA

== SAVE BITMAP FONT AS ==

Filename: "csfont_" (with the underscore)

== AFTER GENERATING FNT AND TGA FILES ==

1. Rename "csfont_.fnt" to "csfont.fnt" (without the underscore);
2. Rename "csfont__0.tga" to "csfont_00.tga";
3. Convert "csfont_00.tga" to BMP format, with pallette of 256 colors max;
4. Make sure the converted BMP has filename "csfont_00.bmp";
5. Open "csfont.fnt" with any hex editor and change the text "csfont__0.tga" to "csfont_00.tga".

The resulting files are attached on this post. I haven't tested it ingame yet, but I guess it's gonna work. What do you think?
 

Attachments

  • csfont_accents.zip
    2.7 KB · Views: 13
Nov 18, 2017 at 10:49 PM
Neophyte Member
"Fresh from the Bakery"
Join Date: Nov 14, 2017
Location:
Posts: 4
Age: 37
Tested it just now. It didn't worked. Although the game recognized the modified file just fine, accents showed in blank, as if it were ignored by the game.

Tried exporting FNT in different encodings, such as unicode and ANSI. But no luck. Guess porting that translation will be a much harder task than I thought.
 
Top