B4J Question B4j How to set the spacing between label words?

byz

Active Member
Licensed User
This is not configurable. You can use multiple spaces. Maybe with a monospace font.

What are you trying to do? Maybe you should use BBLabel (BCTextEngine). With BCTextEngine you can customize many things.
The number spacing on the design drawing is relatively large.
 
Upvote 0

behnam_tr

Active Member
Licensed User
Longtime User
I don't have access to a computer to test.

B4X:
Dim lbl As Label
lbl.Initialize("lbl")
lbl.Style = "-fx-font-size: 14px; -fx-word-spacing: 10px;" ' Adjust 10px as needed
lbl.Text = "This is a sample text with spaced words."

B4X:
Dim spacedText As String = "This" & Chr(0x00A0) & Chr(0x00A0) & "is" & Chr(0x2004) & Chr(0x2004) & "text."
lbl.Text = spacedText
 
Last edited:
Upvote 0

byz

Active Member
Licensed User
I don't have access to a computer to test.

B4X:
Dim lbl As Label
lbl.Initialize("lbl")
lbl.Style = "-fx-font-size: 14px; -fx-word-spacing: 10px;" ' Adjust 10px as needed
lbl.Text = "This is a sample text with spaced words."

B4X:
Dim spacedText As String = "This" & Chr(0x00A0) & Chr(0x00A0) & "is" & Chr(0x2004) & Chr(0×2004) & "text."
lbl.Text = spacedText
thank you, i will try
 
Upvote 0
Top