B4J Question Font Specified in the Layout File is Overridden by CSS

xulihang

Active Member
Licensed User
Longtime User
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.

1730180869486.png


1730180990488.png
->
1730180971561.png



How can I change the default font while keeping the font specified in the layout?
 

xulihang

Active Member
Licensed User
Longtime User
So there is not a good way to modify the default font without overriding the font specified in the layout file?
 
Upvote 0

xulihang

Active Member
Licensed User
Longtime User
This is a way. It's just that I have to specify the CSS for all the special ones.
 
Last edited:
Upvote 0
Top