ionutilie
(Ionut)
December 31, 2021, 1:54pm
1
Hello.
I would like to know if it is possible to allow the user to choose the font with which the text information is displayed.
I would prefer to know for the situation where I have two Google Fonts and the user can choose from them and not for the default fonts in the system.
Thanks in advance for any support!
Choose Font.zip (44.7 KB)
h_classen
(Hans-Gerd Claßen)
December 31, 2021, 4:59pm
2
textToChange.style.setProperty('font-family', 'Inter')
and corresponding ...
always disable 'protect from external styles'
4 Likes
ionutilie
(Ionut)
December 31, 2021, 5:28pm
3
Thank you Hans!
All the best!
MarkHunte
(Mark Hunte)
December 31, 2021, 6:02pm
4
also see an example here using css vars :
This version shows you the advantage of using the vars.
Since we are using a class name with the background, we just have to give that class to other elements. i.e other scene backgrounds.
They will pick up automatically the same colour.
This one also shows you your font change using the same idea and the additional HTML attributes for the font option buttons.
<style>
:root {
--hexcolor: #E8EBED;
--wishTextFont: Inter;
}
.sceneBackground{
background-color: var(--hexcolor)!important;
…
3 Likes