Found the file where I did this, so here's what I've done in my translation experiments so far (or at least the relevant bits):
Code: Select all
translate japanese python:
style.quick_button.xsize = 140
### etc...
## important part
## this is based on the GUI post-7.0 Ren'Py. If you're using the old GUI system, you have to do all related styles in the manner seen above
gui.text_font = basic_font
gui.name_text_font = basic_font
Code: Select all
## in the gui.rpy, so assume init -2 for this
## as before, this applies to the 7.0+ default gui files, but some of the ideas can be applied to custom or old GUI
define default_font = FontGroup().add("fonts/ampersand.ttf", 0x0000, 0x02AF).add("fonts/malgun.ttf", 0xAC00, 0xD7A7).add("fonts/meiryo.ttf", 0x0000, 0xffff)
define gui.text_font = default_font ## used for a lot of gui.rpy font definitions
define gui.name_text_font = default_font
define basic_font = FontGroup().add("fonts/malgun.ttf", 0xAC00, 0xD7A7).add("fonts/meiryo.ttf", 0x0000, 0xffff)
So, what's basically happening:
- At init -2, we create a default font group (or normal font, if you don't need special characters like I do).
- We set the gui.rpy default fonts to the font group we made (one line controls all of those individual styles).
- We create a basic/alternate font group.
- At translate time (after init), if we're set to Japanese instead of None or something else, we change the gui's text font attributes.
- When drawing the screen, the game should (ideally) display the relevant font for whatever language is active.
So far, this has worked fine for me. However, I've not yet set all interface text to use the alternate font, so I'm probably missing a font definition somewhere or it gets baked-in during an init phase. I solved this for myself by using font groups, but if you have entirely different fonts for different languages you may want to look into where the interface text is defined.
At any rate, I hope this helps a bit.
Edit: So, the interface text is set by "gui.interface_text_font". I guess I just missed it because I use the "basic" font for it in my game regardless of language settings.