Page 1 of 1

Multiple fonts variations in .TTF file

Posted: Wed Jul 06, 2022 4:50 am
by Misamor98
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 ?

Re: Multiple fonts variations in .TTF file

Posted: Wed Jul 06, 2022 6:05 am
by Imperf3kt
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