How do you change all fonts after startup?

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
ShiraiJunichi
Miko-Class Veteran
Posts: 651
Joined: Sat May 21, 2005 12:28 pm
Location: University of Utah
Contact:

How do you change all fonts after startup?

#1 Post by ShiraiJunichi » Mon Jul 07, 2008 11:39 am

I'm working on a Vietnamese translation of my game. I would like to provide both English and Vietnamese in the same game, allowing the user to switch back and forth from the menu. This wouldn't be a problem if I used a font that supported both languages. However, my English font is an sfont, and thus supports only English characters.
So how would I change the main menu, game menu, and in-game menu fonts after the game is already running?

Thanks~

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: How do you change all fonts after startup?

#2 Post by PyTom » Mon Jul 07, 2008 12:05 pm

It's somewhat hacky, but the easiest way to do this would be to set the styles at runtime, and then call the undocumented renpy.style.rebuild().
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
x__sinister
Regular
Posts: 153
Joined: Thu Aug 23, 2007 5:34 pm
Projects: Modus Operandi, Grim
Contact:

Re: How do you change all fonts after startup?

#3 Post by x__sinister » Mon Jul 07, 2008 1:16 pm

Well, instead of having it on the menu, you could just translate all the text to your own language, and have the right font, and just have two separate files for the game. That's the way I would do it, but only because I know nothing about Ren'Py. :oops:
Image
A literate roleplaying community.

User avatar
luminarious
Veteran
Posts: 353
Joined: Thu May 01, 2008 1:12 pm
Projects: Winter, winter
Location: Estonia
Contact:

Re: How do you change all fonts after startup?

#4 Post by luminarious » Mon Jul 07, 2008 7:16 pm

I thought I saw a list of characters for the SFonts somewhere in the files.. Could the necessary character be simply added to the list, perhaps?

Post Reply

Who is online

Users browsing this forum: No registered users