B4J Question B4J Font for Listview and adding custom fonts to the designer

Paul_

Member
Licensed User
I want to do something that should be really simple but I cannot figure out how to do it.

I want to set a font for a Listview that does not exist in the designer.

There doesn't seem to be a method to change the Listview font in-program and there doesn't seem to be a way to add new fonts to the B4J designer?

Or am I missing something?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
SS-2018-08-31_08.22.34.png


B4X:
Dim fnt As Font = jFX.LoadFont(File.DirAssets, "Fixedsys500c.ttf", 30)
CSSUtils.SetStyleProperty(ListView1, "-fx-font-family", $"'${fnt.FamilyName}'"$)
For i = 1 To 100
   ListView1.Items.Add($"Item #${i}"$)
Next
 
Upvote 0

Paul_

Member
Licensed User
Thank you very much Erel, I will try that.

So in this case the new font added to the DirAssets folder will be packed automatically with the compiled app right?

Is there a plan in the future to add custom fonts to the B4J designer like they can be added to the B4A designer?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
So in this case the new font added to the DirAssets folder will be packed automatically with the compiled app right?
Yes.

Is there a plan in the future to add custom fonts to the B4J designer like they can be added to the B4A designer?
It might be added in the future.
 
Upvote 0
Top