Python TTF to PNG converter (for custom FNT files)

Programs that will help with modding various Persona & SMT games.
Post Reply
User avatar
Poipt
Posts: 33
Joined: Sat May 16, 2020 12:10 am
Has liked: 2 posts
Been liked: 8 posts

Script: https://gist.github.com/Poipt/687aad39a ... 67ec324d13

I'm pretty sure that this hasn't already been created already but I could be wrong. I'm also not sure how to import custom cuts, so help with that would be appreciated. If I can do that I'll try and figure out a way to automatically detect cuts. Let me know if you have any problems or need clarification on something :)

EDIT: I figured it out so I'm going to try to work on that.

EDIT 2: The font size flag is broken, so don't use it until I update the Gist.
User avatar
Poipt
Posts: 33
Joined: Sat May 16, 2020 12:10 am
Has liked: 2 posts
Been liked: 8 posts

Alright, bugs are fixed and it can automatically create XML cut files.
User avatar
ShrineFox
Site Admin
Posts: 290
Joined: Mon Oct 07, 2019 3:19 am
Has liked: 277 posts
Been liked: 115 posts

This is really rad, thanks so much for taking the time to make and post this! I can see it making the font modding process way more approachable.
User avatar
Poipt
Posts: 33
Joined: Sat May 16, 2020 12:10 am
Has liked: 2 posts
Been liked: 8 posts

After about a day of learning C# image processing, I present to you the incredibly spaghetti coded GUI version of this tool

https://cdn.discordapp.com/attachments/ ... TF2PNG.exe

If you find any bugs or have any questions, let me know :)

btw the S slider is for font size
User avatar
Reishiki
Posts: 7
Joined: Thu Jan 23, 2020 4:00 am
Been liked: 2 posts

Thank you for this! I tried with one of the font I had. After clicking Save, I got an image but it has all sort of characters like Greek, Cyrillic etc that doesn't included in the font file (and I don't need them, either). Also the actual Vietnamese characters I need that included in the font file are nowhere to be found in the PNG. Could you tell me how to fix that?
As I'm not quite sure how to use this program, is there a guide or anything that I should pay attention to when using the program?
User avatar
Poipt
Posts: 33
Joined: Sat May 16, 2020 12:10 am
Has liked: 2 posts
Been liked: 8 posts

Ah, I was wondering about that. I'm not sure exactly what character sequence they use in the original game because it iterates through Japanese characters as well. All I really cared about was English, so it was fine with me. I'll work on it tomorrow. To use the program, click the load button and select the TTF file. After it finishes loading, you should be able to see the whitespace character on the right of the screen. You can use the sliders on the bottom and all the way to the right to scroll through different characters in the image. As for the options on the left the generate XML check box decides whether or not the program should generate the cut data used to get rid of unnecessary space on the sides of the characters. You should check that box before you load the TTF or click refresh, or else it will not generate. X changes the X offset of the characters, and Y changes the Y offset. S changes the font size. Once you change X, Y, or S, you can click refresh to see the updated version. Once you are done, you can press save and it will ask you where you want to save the PNG and XML (if you checked the box) files to. Hope that helps!
Post Reply
cron

ShrineFox 2020 - 2023
Support | Progress | Labs | Privacy | Terms
This site is NOT affiliated, associated, authorized, endorsed by, or in any way officially connected with Atlus Co., Ltd, Atlus U.S.A., Inc. or Sega Games Co., Ltd, or any of its subsidiaries or its affiliates.