Hi all,
at the start of my app I have this code (it works ok on Android)
ERROR: Object was not initialized (UIFont)
What am I missing? TIA
at the start of my app I have this code (it works ok on Android)
B4X:
Public xFontBase As B4XFont 'Font per le B4xView
Public xFontLight As B4XFont
.....
xFontBase = CreateB4XFont("AppleGaramond.ttf", 14, 14) 'per b4xview
xFontLight = CreateB4XFont("AppleGaramond-Light.ttf", 14, 14)
....
'NativeFontSize is needed only for B4J or B4I.
Public Sub CreateB4XFont(FontFileName As String, FontSize As Float, NativeFontSize As Float) As B4XFont
#If B4A
Return xui.CreateFont(Typeface.LoadFromAssets(FontFileName), FontSize)
#Else If B4i
Return xui.CreateFont(Font.CreateNew2(FontFileName, NativeFontSize), FontSize)
#Else
'B4J - unused
Return xui.CreateFont(fx.LoadFont(File.DirAssets, FontFileName, NativeFontSize), FontSize)
#End If
End Sub
What am I missing? TIA