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

后端 未结 9 1724
生来不讨喜
生来不讨喜 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:02

    Android does not support OpenType (OTF), only TrueType (TTF), so your Molot.otf font probably will not work. I wrote both of those blog posts you link to in your opening sentence (the one is a pirated copy of the other), and they do not use Molot.otf.

    (BTW, I somewhat repaired the formatting of that post -- AndroidGuys keeps changing WordPress hosts, and so my older posts are terribly broken in terms of formatting).

    EDIT: As stated in the comments, Android DOES now support OTF.

提交回复
热议问题