Re:How to make the parameter what_font in define character() change with the language

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
xin da ya
Newbie
Posts: 5
Joined: Mon Oct 31, 2022 11:15 am
Contact:

Re:How to make the parameter what_font in define character() change with the language

#1 Post by xin da ya »

I want to translate an English game into Chinese. But it seems that the parameter what_font in character() cannot be changed in the translate python block, I can only add a font to the parameter that displays both Chinese and English, but I want to display the English font when the language is English and the Chinese is another font.

define l = Character ("Intercom", what_font="font/Trebuchet_MS.ttf", what_size=32, ctc=anim.Blink("images/ctc/ctc.png", xanchor=-7, yanchor=-8), ctc_pause=anim.Blink("images/ctc/ctc.png", xanchor=-7, yanchor=-8), ctc_timedpause=Null(), ctc_position="nestled",what_prefix='"', what_suffix='"')
Last edited by xin da ya on Tue Sep 05, 2023 12:10 am, edited 1 time in total.

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: How to make the parameter what_font in define character() change with the language

#2 Post by Ocelot »

Instead of providing what_font, what_size and other style parameters, I would just define a style for this character text and pass it in what_style argument. Then I would use style tranlations to change styles depending on language.
< < insert Rick Cook quote here > >

User avatar
xin da ya
Newbie
Posts: 5
Joined: Mon Oct 31, 2022 11:15 am
Contact:

Re: How to make the parameter what_font in define character() change with the language

#3 Post by xin da ya »

Thank you very much Ocelot!

Post Reply

Who is online

Users browsing this forum: Google [Bot]