Maybe .STYLE_BOLD should be removed from the Intelisence results because that's how I found it.
Dim MyFont As Typeface
MyFont = Typeface.LoadFromAssets("arial_condensed_bold.ttf")
Dim lblCustomer As Label
lblCustomer.Initialize("")
lblCustomer.Typeface=MyFont
lblCustomer.Typeface=Typeface.DEFAULT_BOLD
lblCustomer.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lblCustomer.Text = CusName
lblCustomer.TextSize=20
lblCustomer.TextColor=Colors.RGB(6,14,172)
Dim lblCustomer As Label
lblCustomer.Initialize("")
lblCustomer.Typeface=Typeface.CreateNew(Typeface.LoadFromAssets("arial_condensed_bold.ttf"),Typeface.STYLE_BOLD)
lblCustomer.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lblCustomer.Text = CusName
lblCustomer.TextSize=20
lblCustomer.TextColor=Colors.RGB(6,14,172)
This doesn't work because Style Bold returns integer unlike Typeface "Data Type".Hi Everyone,
Can you show the needed coding that will apply Bold to the Text of a label?
I tried this but the syntax is wrong:
B4X:LabelStoreName.Typeface = Typeface.STYLE_BOLD
Thanks.
2022 Solution:This doesn't work because Style Bold returns integer unlike Typeface "Data Type".
Dim xLabel As B4XView
xLabel.Font = xui.CreateDefaultBoldFont(15)