“RuntimeException: native typeface cannot be made” when loading font

后端 未结 9 1677
生来不讨喜
生来不讨喜 2020-12-05 09:35

I am attempting to use a custom font for a TextView on Android, following the guide here. Using the same font, same code, same everything, I get this in adb logcat:

9条回答
  •  有刺的猬
    2020-12-05 10:03

    I also get the same error and I have solution follow.

    Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Molot.otf")
    

    you must put fonts/Molot.otf in assets/fonts folder in your Eclipse.

    after you can Run it.

    if you can not Run it successfull you can send proplem via

提交回复
热议问题