Loading new font generated an error

jjcc

Member
Licensed User
Longtime User
Hello fellow b4a guys,

I'm trying to load a new LED font. I'm using the same code as in documentation

B4X:
   Dim LedFont As Typeface
   LedFont = Typeface.LoadFromAssets("LED7i.ttf")
   
   lblWeightValue.Typeface = LedFont

but an error was generated as:
B4X:
java.lang.RuntimeException: native typeface cannot be made
   at android.graphics.Typeface.<init>(Typeface.java:147)
   at android.graphics.Typeface.createFromAsset(Typeface.java:121)
   at anywheresoftware.b4a.keywords.constants.TypefaceWrapper.LoadFromAssets(TypefaceWrapper.java:40)

I've checked the ttf file. There's no problem. (see attached zip file). I put the ttf file under the "File" directory

Any ideas?
 

Attachments

  • LED7i.zip
    8.4 KB · Views: 237
Last edited:

jjcc

Member
Licensed User
Longtime User
fixed:

I should use the "file tab" at the right panel in IDE to add the ttf file into the project.

Sorry I didn't read the documentation carefully
 
Upvote 0
Top