font: different files for bold and italic

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
riktik
Newbie
Posts: 5
Joined: Mon Mar 20, 2006 1:51 pm
Location: Rome (Italy)
Contact:

font: different files for bold and italic

#1 Post by riktik »

I've decided to use for my game a font ("animeace") that has three files:
animeace.ttf
animeace_b.ttf -> bold
animeace_i.ttf -> italic

I've put the three files in my game directory.
and, in my script, the command:
$ style.default.font = "animeace.ttf"

How I have to define the italic and bold files?

When I use {b} {i} it seems that ren'py doesn't use the other font files automatically.

thank you in advance


marco

ps Oh yes, I'm new here. W Ren'Py!

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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:

#2 Post by PyTom »

This is what config.font_replacement_map is for. So what you'd want to do is to add code like:

Code: Select all

init:
     $ config.font_replacement_map[('animeace.ttf', True, False)] = ('animeace_b.ttf', False, False)
     $ config.font_replacement_map[('animeace.ttf', False, True)] = ('animeace_i.ttf', False, False)
Hope this helps, and welcome!
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

riktik
Newbie
Posts: 5
Joined: Mon Mar 20, 2006 1:51 pm
Location: Rome (Italy)
Contact:

#3 Post by riktik »

PyTom wrote: Hope this helps, and welcome!
Thank you PyTom,

I'm sorry if in the next week I'm going to post some silly questions, but I'm near to complete my game and I want to polish up my code.

Consider that english isn't my native language and I had some troubles to understand and consult the Reference Manual. Luckily the examples are very well commented and I could learn the basis of Ren'Py easily.

marco

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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:

#4 Post by PyTom »

riktik wrote:Consider that english isn't my native language and I had some troubles to understand and consult the Reference Manual.
To be honest, the reference manual is hard to understand even for people who speak English as a first language.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot], NoFanru