Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private fnt As B4XFont
Private lbl1 As Label
Private lbl2 As Label
Private lbl3 As Label
Private lbl4 As Label
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
'load the layout to Root
Root.LoadLayout("frmWebFont")
fnt = xui.CreateFont(LoadWebFont,26)
lbl1.Font = fnt
lbl1.Text = $"${Chr(0xf521)} toggle-switch"$
lbl2.Font = fnt
lbl2.Text = $"${Chr(0xf522)} toggle-switch-off"$
lbl3.Font = fnt
lbl3.Text = $"${Chr(0xfa18)} toggle-off-outline"$
lbl4.Font = fnt
lbl4.Text = $"${Chr(0xfa19)} toggle-switch-outline"$
End Sub
Private Sub LoadWebFont As Object
#if B4J
Dim fx As JFX
Return fx.LoadFont(File.DirAssets, "materialdesignicons-webfont.ttf", 30)
#else if B4A
Return Typeface.LoadFromAssets("materialdesignicons-webfont.ttf")
#else if B4i
' For Each f As String In Font.AvailableNames
' LogPrt(f)
' Next
Return Font.CreateNew2("Material-Design-Icons", 32)
#End If
End Sub