Hyperlink text: preserve font family of containing text

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
komehara
Regular
Posts: 36
Joined: Fri Jan 31, 2020 10:08 pm
Projects: Spirit Link
Tumblr: hsandt
Deviantart: hsandt
Github: hsandt
itch: komehara
Contact:

Hyperlink text: preserve font family of containing text

#1 Post by komehara »

I found out that all hyperlinks were using some default sans-serif font in the middle of my serif interface text (e.g. the About page).

I found this style in screens.rpy:

Code: Select all

style hyperlink_text:
    properties gui.text_properties("hyperlink", accent=True)
    hover_underline True
so I decided to overwrite the font family to match the rest of my interface:

Code: Select all

define gui.hyperlink_text_font = gui.interface_text_font
It works here because there are only hyperlinks in standard interface content. But I *could* have hyperlinks in multiple places, some in ingame dialogues, some in menus, some on special pages with custom fonts, in which case the overwrite would only work for one of them and the font would still look out of place in the other places using different fonts.

Is there a way to just order hyperlink_text to keep using the containing text's font family?

(another issue with hyperlink style, but about size: viewtopic.php?p=470985&hilit=hyperlink+font#p470985 - in my case size is OK, it is automatically set to containing text size)

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot]