Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | nonomiyo |
Hello !
I set up 2 DynamicFonts ( engfont.tres for English and japfont.tres for Japanese) and I would like to be able to switch my label’s font depending on the language option selected.
Basically, this is what I’d like to do :
func _on_japanese_pressed():
var typo = load("res://fonts/japfont.tres")
label.font = typo
label.text = "日本語 (japanese)"
Invalid set index ‘font’ (on base: ‘Label’) with value of type ‘DynamicFont’
What is the correct way of putting it please ?
thank you !
Try defining one or several fallback fonts in the English DynamicFont resource. This way, you won’t have to define create font resources and the font will be swapped automatically when the glyph cannot be found in the original (English) font.
Calinou | 2018-09-18 15:56