Using author supplied fonts

mjtaryan

Active Member
Licensed User
Longtime User
Is it possible to use special or author supplied fonts for Labels and EditText views. If so, how is this done? Thanks.
 

mjtaryan

Active Member
Licensed User
Longtime User
Never mind. I think I found what I needed to know. I am, however, assuming that external fonts can be used by either Labels or EditText.
 
Upvote 0

MrRey

Member
Licensed User
Longtime User
Here's the way I did it. First, click on your Files tab and add the font file. I've used TTF and OTF fonts so far with no problems.

Then add something like this:
B4X:
Sub Process_Globals
     Dim myFont As Typeface
End Sub

In my code I used:
B4X:
myFont = Typeface.LoadFromAssets("rawengulksans.otf")
lblTitle.Typeface = myFont

Just be sure to use a font to which you have the legal right to distribute, such as public domain fonts. Just check the licensing.

I've used fonts with anything with a label inside, including listviews.
 
Upvote 0
Top