ZaraUbermensch Posted October 14, 2020 Posted October 14, 2020 I've started a Fortissimo EXS translation project from japanese to portuguese but i need help to edit the game font, i couldn't find the font anywhere in the game files, so I've come here to see if anyone can help me with this, any help would be highly appreciated, thanks in advance. Quote
tahu157 Posted October 17, 2020 Posted October 17, 2020 A VN's font is usually embedded in the exe itself. You'd have to dig around in the exe with a decompiler to find the font and even then you may or may not be able to replace it and still have the VN run properly. ZaraUbermensch 1 Quote
binaryfail Posted October 17, 2020 Posted October 17, 2020 The font name can be found in the exe (in this case, it is MS 明朝) which can be patched via a hex edit, or overridden with other means. But that's the easy part. For Portuguese, you also need to have some way to use accented letters, which is something not natively supported in SJIS encoding. There are some ways to handle that, such as an edited font, or patching in support to the exe. This game's engine doesn't accept normal ASCII text in the script, so you're forced to use full-width letters which makes everything look wide in the game. That also can be fixed by patching the exe, which seems to have a hardcoded amount for the text's letter spacing. A decent looking starting point could look like this. The new font being used here is Comic Sans MS, of course. ZaraUbermensch and Fiddle 2 Quote
ZaraUbermensch Posted October 17, 2020 Author Posted October 17, 2020 14 hours ago, binaryfail said: The font name can be found in the exe (in this case, it is MS 明朝) which can be patched via a hex edit, or overridden with other means. But that's the easy part. Thank you so much for the help. But the thing is that I have no experience with hex editing, I managed to find the MS Mincho(MS 明朝) using HxD but I could only replace it with another japanese font (like MS Gothic), when i try to replace it with anything else the game just uses a backup font that looks like a glitched MS Gothic. Forgive me if I'm asking too much, but can you tell me what you did to replace the game font? And yes I do like comic sans Quote
binaryfail Posted October 18, 2020 Posted October 18, 2020 Most of the font overrides I did were handled with a dll that I wrote. Here's my current one for it, just put it in the same folder as the game exe. Finally, the text spacing is a hex edit on the exe. Since I did my testing on the disc release of EXS, these next instructions will only work for that version. Use a hex editor and look at address 1CA32 in the exe, and you should see the bytes A1 B8 52 BB 00 ..... now overwrite those with B8 0C 00 00 00 where 0C is the amount of spacing. Something between 09 and 0C should suffice, depending on the font. I should mention that a bunch of technical considerations will need to be kept in mind, but I'll let you try it first and see how that goes. ZaraUbermensch 1 Quote
ZaraUbermensch Posted October 18, 2020 Author Posted October 18, 2020 18 hours ago, binaryfail said: Most of the font overrides I did were handled with a dll that I wrote. Here's my current one for it, just put it in the same folder as the game exe. Finally, the text spacing is a hex edit on the exe. Since I did my testing on the disc release of EXS, these next instructions will only work for that version. Use a hex editor and look at address 1CA32 in the exe, and you should see the bytes A1 B8 52 BB 00 ..... now overwrite those with B8 0C 00 00 00 where 0C is the amount of spacing. Something between 09 and 0C should suffice, depending on the font. Your dll works flawlessly, I could override the game font by any other font that is installed in the system, the text spacing hex edit also worked with my game version. So there were two problems that i encountered, the first is that to use accented characters I tried to edit a font, but that doesn't seem to work because any letter that comes after the edited character just gets glitched like a square, maybe the solution to this is to patch the game exe just like you said? (or I'm doing something wrong with the font idk). And the other problem is that the game doesn't break the lines with full-width letters, so the text just goes way over the textbox's limits. Quote
binaryfail Posted October 18, 2020 Posted October 18, 2020 (edited) Accented characters: The square symbols is probably because the character was misinterpreted as something else by the font. What tool are you using to edit the game's MES files? This will ultimately need to be customized to work appropriately with whatever way you're handling accented letters in your script + font. When I did accented letters for my example, I essentially remapped accented symbols to the 91xx SJIS range and the dll would map them back to the intended codepoint. For example, ê is 0xEA in unicode/cp1252 and outputted as 91EA in the script file. Line breaks: the game expects the script to provide explicit line breaks in the text using the 0A byte. That means your editing tool needs to be able to insert line breaks into the text; the game will not auto-break lines by itself. Edited October 18, 2020 by binaryfail ZaraUbermensch 1 Quote
ZaraUbermensch Posted October 18, 2020 Author Posted October 18, 2020 I'm using Circus Editor by marcussacana to edit the MES files, it seems that breaking the lines was pretty easy but I didn't know about the 0A byte, now this is one less problem to deal with. 2 hours ago, binaryfail said: When I did accented letters for my example, I essentially remapped accented symbols to the 91xx SJIS range and the dll would map them back to the intended codepoint. For example, ê is 0xEA in unicode/cp1252 and outputted as 91EA in the script file. I'm really interested on how you remapped those symbols to a shift jis range as it looks easier than editing the font cluelessly. Thanks for all your help! This is the only thing left (I think) and the project can finally get going. Quote
binaryfail Posted October 18, 2020 Posted October 18, 2020 (edited) Does CircusEditor have a way to add a line break or did you have to paste it in another way? For the 91xx remapping, I used a hex editor to add a 0x91 byte in front of each accented letter. This was easy to do manually since it's just one or two sentences for my example text. I started with typing it as regular text, viewed as codepage-1252 Olá, este é um teste Add a 91 byte in for each accented letter, viewed as sjis Ol黛, este 鷹 um teste Convert the remaining letters to full-width in sjis Ol黛, este 鷹 um teste ...and then paste the resulting text into the script. It should be possible to automate the procedure above for your translation. One way would be to add support for remapping accented letters within CircusEditor -- it is open-source. My dll also remaps the full-width alphabet back to ASCII so the letters look normal instead of wide in the game, and it was usually necessary when non-Japanese fonts don't have support for sjis codepoints. Edited October 18, 2020 by binaryfail ZaraUbermensch 1 Quote
ZaraUbermensch Posted October 19, 2020 Author Posted October 19, 2020 I added the option to line break as well your suggestion to automate that procedure onto CircusEditor. The only thing that I didn't account for was that the name of the characters doesn't appear on the CircusEditor, so i can't edit them. (For some reason i can't insert an image from an URL so I will just post the link here https://imgur.com/gL9ndEl) I don't know if you know any workaround to this, maybe i'm asking too much. anyways, thanks a lot! Quote
binaryfail Posted October 19, 2020 Posted October 19, 2020 (edited) For character names, you can modify the code in CircusEditor to recognize the 0x4D command for name strings. Look for this block of code in CircusEditor\Main.cs and change it to this... (I added the parts where SrhPrx2 is involved.) //Search Text - (EXS) SrhPrx = new byte[] { 0x00, 0x4E }; byte[] SrhPrx2 = new byte[] { 0x00, 0x4D }; for (uint i = ByteCodeStart; i < Script.Length - 2; i++) if ((EqualsAt(SrhPrx, i) || EqualsAt(SrhPrx2, i)) && (Script[i + 2] != 0x00 || Script[i + 3] != 0x00)) { i += 2; if (Script[i] <= 0x3 || Script[i + 1] <= 0x3 || Script[i + 2] <= 0x3) continue; Offsets.Add(i); } There's another piece where very short strings get ignored, so we'll need to disable that. Just comment (or remove) these 2 lines... if (Missmatch >= Str.Length / 3) Result = false; And one more thing... The protagonists' names are stored in the savedata, and the initial copy of that will come from the exe file! Use a hex editor around 0x76060 in the exe to change them. Of course, they'll need to be in double-width sjis. You can also edit the names in your existing save file if you want -- it's located in AdvData\SaveData\system.dat Edited October 19, 2020 by binaryfail Quote
ZaraUbermensch Posted October 19, 2020 Author Posted October 19, 2020 Hey! Sorry for the late reply, I've stumbled into another problem that I didn't account for. Apparently the game's images are protected and cannot be replaced, using GarBro to check those images it says that they are in the circus engine image format, I could not find anyway to replace the images and extracting them to another format renders the game unable to read the images, maybe there's something that can repack bitmap to .crx? Quote
binaryfail Posted October 20, 2020 Posted October 20, 2020 (edited) I couldn't find any encoders for Circus's crx format, so I wrote my own: get here. It's a very simple command-line tool. It will only accept png files for input since I'm not fond of using bmp for images that have an alpha channel. Edited October 20, 2020 by binaryfail Quote
ZaraUbermensch Posted October 26, 2020 Author Posted October 26, 2020 Hey! sorry for the late reply (again), your encoder works just fine, thanks! But I`ve had some troubles here. So, one thing that I did not realize before is that CircusEditor doesn't display all the lines of the script when the game is on the NVL mode (when the textbox takes over almost the entire screen), it only displays the first line of each textbox from the NVL mode so I cannot edit all the text in the script, I've tried a few things but with no success. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.