Using Other Fonts in the Designer

Fox

Active Member
Licensed User
Longtime User
Hello Guys.

Is it possible that i can use another font for my label?
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hi Fox,
This code works well for me.

B4X:
Sub Globals
   Dim TimeFont As Typeface
   Dim ClockFont As Typeface
   Dim NASAFont As Typeface
   Dim font As Int
End Sub

Sub Activity_Create(FirstTime As Boolean)
   TimeFont = Typeface.LoadFromAssets("digital.ttf")
   ClockFont = Typeface.LoadFromAssets("clockopia.ttf")
   NASAFont = Typeface.LoadFromAssets("nasalization.ttf")
   Select font
      Case 0: labDigital.Typeface = TimeFont
      Case 1: labDigital.Typeface = ClockFont
      Case 2: labDigital.Typeface = NASAFont
      Case 3: labDigital.Typeface = Typeface.DEFAULT
   End Select
End Sub

Attached snap demonstrates the NASA font.
 

Attachments

  • device.jpg
    device.jpg
    12.8 KB · Views: 880
Upvote 0

Dario126

Member
Licensed User
Longtime User
Is there a way to make it default through all application, or it must be assigned to each control (view) separately ?
 
Upvote 0
Top