Fonts question

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
TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

Fonts question

#1 Post by TamakiShibo »

how i should change fonts in ren py? in renpy's documentaion it says that i should place font IN A GAME DIRECTORY. what does it mean? where exactly is a folder i should put my font file in??? like, i know that i should write or rewrite something in gui.rpy, and put my font IN A GAME DIRECTORY (sory for bad english)

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Fonts question

#2 Post by xavimat »

Pretty easy.
1. First you need the file of the font (.ttf, .otf...) Be aware that fonts can have also copyrights, so be sure before using them. There are a lot of fonts for example here: http://www.fontsquirrel.com/

2. Put the file in the game directory or in a subdirectory of your project. (I usually put them in the "gui" subdirectory)

3. Go to gui.rpy. There are three variables that control the fonts. They are by default set to "DejaVuSans.ttf".

Code: Select all

## The font used for in-game text.
define gui.text_font = "DejaVuSans.ttf"

## The font used for character names.
define gui.name_text_font = "DejaVuSans.ttf"

## The font used for out-of-game text.
define gui.interface_text_font = "DejaVuSans.ttf"
Change that lines with the name of the file (not the name of the font but the name of the file). Put also the path. For example, if I put the file "comic.ttf" in the gui directory, the code should be:

Code: Select all

define gui.text_font = "gui/comic.ttf"

Ask if it's not clear (English is not my language, either).
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

TamakiShibo
Regular
Posts: 27
Joined: Sat Jul 07, 2018 1:24 pm
Contact:

Re: Fonts question

#3 Post by TamakiShibo »

my mistake was that i not typed in path to the font. thanks a lot!

Post Reply

Who is online

Users browsing this forum: dragondatingsim