Changing the font used in History screen? [SOLVED]

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
User avatar
Rainvillain
Regular
Posts: 76
Joined: Thu Mar 05, 2015 11:27 am
Contact:

Changing the font used in History screen? [SOLVED]

#1 Post by Rainvillain »

[EDIT: I SOLVED THIS TEN SECONDS AFTER POSTING HAHA. I'm keeping this post up instead of deleting it in case it helps anyone else! Solution at the bottom of the post]

Hi there,

I'm wondering if there's a way of changing the font used in my game's History/Log section? Currently it uses the font I've defined for "out-of-game text" in the gui.rpy:

Code: Select all

## The font used for out-of-game text.
define gui.interface_text_font = "menufont.ttf"
But I only want to use that font for my menus etc., in the History screen it looks too crunchy and, crucially, it's missing some of the characters that are present in my game (french "accents", chinese script, japanese kana, etc.).

So I'm hoping to use a more universal font for my History section, the problem is I don't know how to JUST change the font in the History section.

I tried playing around with variations on:

Code: Select all

#define gui.history_text_font = "universalfont.ttf"
But those either bring error codes or do nothing at all. Is there an easy way to exclusively change the History font?


SOLUTION: Under "style history_text:" in the screens.rpy, I added:

Code: Select all

font "DejaVuSans.ttf"
So it looks like this:

Code: Select all

style history_text:
    xpos gui.history_text_xpos
    ypos gui.history_text_ypos
    xanchor gui.history_text_xalign
    xsize gui.history_text_width
    min_width gui.history_text_width
    text_align gui.history_text_xalign
    layout ("subtitle" if gui.history_text_xalign else "tex")
    font "DejaVuSans.ttf"

Post Reply

Who is online

Users browsing this forum: giorgi1111