xulihang Active Member Licensed User Longtime User Oct 29, 2024 #1 I want to change the default font with the following CSS and code: CSS: .text { -fx-font-family: "SimSun"; } B4X: MainForm.Stylesheets.Add(File.GetUri(File.DirApp,"font.css")) But the font specified in the layout file is been overridden. -> How can I change the default font while keeping the font specified in the layout?
I want to change the default font with the following CSS and code: CSS: .text { -fx-font-family: "SimSun"; } B4X: MainForm.Stylesheets.Add(File.GetUri(File.DirApp,"font.css")) But the font specified in the layout file is been overridden. -> How can I change the default font while keeping the font specified in the layout?
Erel B4X founder Staff member Licensed User Longtime User Oct 29, 2024 #2 You will need to set the font with CSS: B4X: CSSUtils.SetProperty(Button1, "-fx-font-family", "FontAwesome") Upvote 0
You will need to set the font with CSS: B4X: CSSUtils.SetProperty(Button1, "-fx-font-family", "FontAwesome")
xulihang Active Member Licensed User Longtime User Oct 29, 2024 #3 So there is not a good way to modify the default font without overriding the font specified in the layout file? Upvote 0
So there is not a good way to modify the default font without overriding the font specified in the layout file?
Erel B4X founder Staff member Licensed User Longtime User Oct 30, 2024 #4 You can use DDD (designer script extension) and group a set of views based on class. This will make it easier to set their font. Upvote 0
You can use DDD (designer script extension) and group a set of views based on class. This will make it easier to set their font.
P PaulMeuris Well-Known Member Licensed User Oct 30, 2024 #5 It seems that if you specify Extra CSS in the layout then that CSS is taken... Upvote 0
xulihang Active Member Licensed User Longtime User Oct 30, 2024 #6 This is a way. It's just that I have to specify the CSS for all the special ones. Last edited: Oct 30, 2024 Upvote 0