1. Download the free trial version

Loading new font generated an error

Discussion in 'Questions' started by jjcc, Mar 6, 2012.

Similar threads

Question load fonts
Tool Tag Cloud
Question Problem using Fonts
Question Custom Font Issue
Question making a font bold
  1. jjcc

    jjcc Member Licensed User

    Hello fellow b4a guys,

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

    Code:
    Dim LedFont As Typeface
       LedFont = 
    Typeface.LoadFromAssets("LED7i.ttf")
       
       lblWeightValue.Typeface = LedFont
    but an error was generated as:
    Code:
    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?

    Attached Files:

    Last edited: Mar 6, 2012
  2. jjcc

    jjcc Member Licensed 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

Share This Page

Loading...