Ren'Py Renpy Game multi Language how to set different fonts?

ShihChang

New Member
Jul 17, 2023
5
0
Good night everyone, sorry my English is not good, so I use a translator to assist me to ask questions, so if there are some mistakes in grammar, sorry, I am from Taiwan. The main languages are Chinese and Spanish. I have a translation problem now , if it is multilingual when I translate the game. For example, if yours speak English, there is no problem with English or Spanish fonts, as shown in Figure 1 and Figure 2. But if it is Chinese, need another font, otherwise the text will not appear as shown in Figure 3. Do yours knows which dile, can I set multi-language and multi-fontss by modifying it? I hope yours can teach me, thank yours. I am currently modifying the font in gui.rpy and can only use one type as shown in Figure 4. Thank everyone for your selfless teaching.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,964
16,207
[...] can I set multi-language and multi-fontss by modifying it?
Yes you can, as said (link in Chinese).

You need to double all the styles where you defined a font, for them to use an alternate one depending on the language currently selected.

Normally adding this to your project should works and be enough:

Python:
translate chinese style default:
    font "your_font.ttf"

translate chinese python:
    gui.text_font = "your_font.ttf"
    gui.name_text_font = "your_font.ttf"
    gui.interface_text_font = "your_font.ttf"
In my example I assumed that you named the language "chinese", change it if you used another name, or have upper case(s).
 
  • Like
Reactions: gojira667

ShihChang

New Member
Jul 17, 2023
5
0
Yes you can, as said (link in Chinese).

You need to double all the styles where you defined a font, for them to use an alternate one depending on the language currently selected.

Normally adding this to your project should works and be enough:

Python:
translate chinese style default:
    font "your_font.ttf"

translate chinese python:
    gui.text_font = "your_font.ttf"
    gui.name_text_font = "your_font.ttf"
    gui.interface_text_font = "your_font.ttf"
In my example I assumed that you named the language "chinese", change it if you used another name, or have upper case(s).
Thank you for teaching me the way, I have seen the manual but I don’t know which file to modify, because I have tried to modify it but it has not been successful Orz I don’t know where the mistake is xD