Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Arecher |
I was wondering whether there is a way to set the font a char_fx uses in a RichTextEffect.
I cannot find anything about it in the documentation, but RichTextLabels can use [font=<path>] [/font]
, so I’m hoping custom effects can do the same.
I basically want to make that same effect, but through a custom RichTextEffect. I’d rather not have to write down the fontpath in each RichTextLabel, so I want to select a font through a name indicator. Writing down the paths in a single effect would make it easier to adjust them later (in case the path changes in the future), and would require less writing/path copying.
Here’s what I have so far.
extends RichTextEffect
var bbcode = "f"
func _process_custom_fx(char_fx):
var font
match char_fx.env.get("name"):
"font1": font = load("res://user interface/fonts/customfont1.tres")
char_fx. ????
return true
I’m wondering if there is a way to set the font
property of the char_fx
. Perhaps char_fx.font
or char_fx.character.font
I essentially want to write [f name=font1] *text* [/f]
to adjust the font
of the text to font1