Changing fonts only in specific areas

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
peachmochie
Newbie
Posts: 1
Joined: Thu Apr 14, 2022 11:37 pm
Contact:

Changing fonts only in specific areas

#1 Post by peachmochie »

This is my first VN, and I'm getting the hang of things pretty quickly, but a detail I'd really like to include is having the characters names presented each with a different font.

The rest of it can stay as one single font but I want the names of the characters to feel like their 'signature' you know? Any tips on how to achieve this would be greatly appreciated.

laure44
Regular
Posts: 84
Joined: Mon Mar 08, 2021 10:55 pm
Projects: Arkan'sTower, Gemshine Lorelei!
Location: France
Contact:

Re: Changing fonts only in specific areas

#2 Post by laure44 »

Code: Select all

define e = Character("Eileen", who_font = "yourfont", what_font = "yourfont")
where who_font will change the name of the character, and what_font will change their dialogue.

User avatar
Per K Grok
Miko-Class Veteran
Posts: 882
Joined: Fri May 18, 2018 1:02 am
Completed: the Ghost Pilot, Sea of Lost Ships, Bubbles and the Pterodactyls, Defenders of Adacan Part 1-3, the Phantom Flyer
itch: per-k-grok
Location: Sverige
Contact:

Re: Changing fonts only in specific areas

#3 Post by Per K Grok »

peachmochie wrote: Thu Apr 14, 2022 11:39 pm This is my first VN, and I'm getting the hang of things pretty quickly, but a detail I'd really like to include is having the characters names presented each with a different font.

The rest of it can stay as one single font but I want the names of the characters to feel like their 'signature' you know? Any tips on how to achieve this would be greatly appreciated.
There are different ways to set a specific font for certain texts.

If you want the name, of the different characters set before a line of dialog, to have a different font, you can set that in the definition like the example below.
The example is made on the premise that the font you want is named font1.tff and you have placed it in a sub-folder named 'fonts' in the game-folder. The example also contains setting the size and color of the text.

define e = Character("Eileen", who_font="fonts/font1.ttf", who_size=25, who_color="#f00")

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], snotwurm