Hi to all,
font displayed is always the default, Why?
This is my simple code:
Thanks
font displayed is always the default, Why?
This is my simple code:
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim myfont As Typeface
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Label1.Initialize("Label1")
Activity.LoadLayout("Main")
change_font
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub change_font
myfont = Typeface.LoadFromAssets("Ozone.ttf")
myfont = Typeface.DEFAULT
Label1.Typeface = myfont
If myfont.IsInitialized = False Then Msgbox("Error", "Error")
End Sub
Thanks