Paul_ Member Licensed User Aug 31, 2018 #1 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?
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 Aug 31, 2018 #2 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
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
Paul_ Member Licensed User Aug 31, 2018 #3 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
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?
Erel B4X founder Staff member Licensed User Longtime User Aug 31, 2018 #4 Paul_ said: So in this case the new font added to the DirAssets folder will be packed automatically with the compiled app right? Click to expand... Yes. Paul_ said: Is there a plan in the future to add custom fonts to the B4J designer like they can be added to the B4A designer? Click to expand... It might be added in the future. Upvote 0
Paul_ said: So in this case the new font added to the DirAssets folder will be packed automatically with the compiled app right? Click to expand... Yes. Paul_ said: Is there a plan in the future to add custom fonts to the B4J designer like they can be added to the B4A designer? Click to expand... It might be added in the future.