Multiple fonts variations in .TTF file

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
Misamor98
Newbie
Posts: 19
Joined: Wed Jul 14, 2021 4:43 pm
Contact:

Multiple fonts variations in .TTF file

#1 Post by Misamor98 » Wed Jul 06, 2022 4:50 am

Hi,

I wanna use a specific font in my project (Bahnschrift) and it has multiple specific variations, namely :

Light Condensed
Light SemiCondensed
Light
SemiBold Condensed
etc...

So I know that to use a specific font you need to input the file name in the right place, like what I have done here for the Oswald font :

define gui.text_font = "Oswald.ttf"

But how do I tell Ren'py what specific variation of the font I want to use if they're all part of a single .ttf file ?

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3636
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Multiple fonts variations in .TTF file

#2 Post by Imperf3kt » Wed Jul 06, 2022 6:05 am

I think you are referring to a truetype collection .ttc file

From the documentation https://www.renpy.org/doc/html/text.html#fonts
Ren’Py also supports TrueType/OpenType collections that define more than one font. When accessing a collection, use the 0-based font index, followed by an at-sign and the file name. For example, “0@font.ttc” is the first font in a collection, “1@font.ttc” the second, and so on.

Basically open the font collection, and see what 'number' the font you want to use is at, starting at 0
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], minyan