Refer to this ,after to resolved from PaulMeuris's advice ,but it isn't completely about B4i
my code now is belows
my code now is belows
B4X:
' Font Property Setter
Public Sub setFont(newFont As B4XFont)
mFont = newFont
#If B4J
If xLBL.IsInitialized Then
CSSUtils.SetStyleProperty(xLBL,"-fx-font-weight","bold")
CSSUtils.SetStyleProperty(xLBL,"-fx-font-size",mTextSize)
'CSSUtils.SetStyleProperty(xLBL,"-fx-font-family","playpensansthai-extrabold")
CSSUtils.SetStyleProperty(xLBL,"-fx-font-family",mFont.ToNativeFont.FamilyName)
End If
#Else If B4A
If xLBL.IsInitialized Then
xLBL.Font = mFont
End If
#Else 'B4i
??? 'I don't have Mac devices and B4i product
#End If
End Sub