• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Ren'Py Individual font settings for translation

WetMelonPlay

Member
Game Developer
Dec 13, 2021
122
404
I ran into this problem. When changing the language in my game to Spanish, some characters are displayed incorrectly.

I found a different font for Spanish.

And I wrote the following in the code:
Python:
translate Espanol python:
    gui.text_font = "fonts/Onest-Regular.ttf"
    gui.name_text_font = "fonts/Onest-Regular.ttf"
    gui.interface_text_font = "fonts/Onest-Regular.ttf"
    style.default.font = "fonts/Onest-Regular.ttf"
    gui.font = "fonts/Onest-Regular.ttf"
    gui.button_text_font = "fonts/Onest-Regular.ttf"


This solved the character display problem. But a new problem appeared. The font size needs to be corrected to display correctly.

2024-05-02_15-56-38.png

Can you suggest something?
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
4,964
7,282
You can set the font size to match the same size as the other font. You want them to be of the same (or very similar size).
Some words in a language are longer than others, and in that case fit comes to rescue (Here's a nice tutorial, better than the renpy documentation to show how each thing works: )
Here's the documentation: but most of the default things (like dialogue box) already do that.

However, when it comes to main menu, you have only 2 options I can think of: Best fit (Which decreases the font's size to match the size of the container) or fit (which breaks the text into multiple lines), both would be ugly.
Your best option is to be clever with the translation of some voices and find a synonym that matches the size of the rest of the options. I am sure you can find a shorter word than "Expresiones de gratitud".

-edit-
Also, are you spanish or using google translate?
"Expresiones de gratitud" sounds very weird to me as something you'd want in a menu. Sounds very off.
 

WetMelonPlay

Member
Game Developer
Dec 13, 2021
122
404
You can set the font size to match the same size as the other font. You want them to be of the same (or very similar size).
Some words in a language are longer than others, and in that case fit comes to rescue (Here's a nice tutorial, better than the renpy documentation to show how each thing works: )
Here's the documentation: but most of the default things (like dialogue box) already do that.

However, when it comes to main menu, you have only 2 options I can think of: Best fit (Which decreases the font's size to match the size of the container) or fit (which breaks the text into multiple lines), both would be ugly.
Your best option is to be clever with the translation of some voices and find a synonym that matches the size of the rest of the options. I am sure you can find a shorter word than "Expresiones de gratitud".

-edit-
Also, are you spanish or using google translate?
"Expresiones de gratitud" sounds very weird to me as something you'd want in a menu. Sounds very off.
Thank you. I'll look into the materials. My Spanish level is 0.

It's a "fan" translation.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,198
14,930
Can you suggest something?
Yes, either the use of , as said by the doc, right above where you got the translation dedicated python bloc :
Python:
translate Espanol style default:
    size 22  # or whatever size you need.
or the said translation dedicated python bloc to alter the font size defined by the gui :
Python:
translate Espanol python:
    gui.text_size = 22  # or whatever size you need.
 
  • Like
Reactions: WetMelonPlay

moskyx

Engaged Member
Jun 17, 2019
3,884
12,489
Yup, the translation is faulty. 'Lleno' is not a valid translation for fullscreen mode, "Completa" would be the exact word for this purpose