B4J Question -fx-font-family with custom font

tufanv

Expert
Licensed User
Longtime User
Hello ,

is it possible to assign a custom font to a textfield ?

I load the font with:

fx.LoadFont(File.DirAssets,"TitilliumWeb-SemiBold.ttf",14)

When I list the font family names it is "Titillium Web" and it works with labels. but when i try :

CSSUtils.SetStyleProperty(txtlive,"-fx-font-family","Titillium Web")

It does not work. What is my mistake?

TY
 

besoft

Active Member
Licensed User
Longtime User
txtlive.Font = fx.LoadFont(File.DirAssets,"TitilliumWeb-SemiBold.ttf",19)

Try this
 
Upvote 0
Top