Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue when using a custom font - "native typeface cannot be made"

I'm trying to use a font I found on the internet, but the problem is that I get an FC with "native typeface cannot be made".

Here is the code in the getView of my ListVIew:

        holder.tv_SuraName   =(TextView)convertView.findViewById(R.id.Start_Name);         holder.tv_SuraName.setTypeface(Typeface.createFromAsset(mContext.getAssets(), "suralist_font.ttf")); 

Can anyone tell me why can I use the custom rom? You can get it HERE .. the file is .ttf

like image 231
Omar Avatar asked Sep 23 '11 16:09

Omar


2 Answers

My problem was incorrect placement of the assets folder.

When using Android Studio the assets folder should be inside of the source sets e.g.

src/main/assets/

Found in this answer

like image 108
roelvogel Avatar answered Sep 19 '22 03:09

roelvogel


The font file is either corrupt or unsupported for some reason. You can drop it on the SD card and load it from file, to make sure it's not a problem with your assets.

like image 21
Nikolay Elenkov Avatar answered Sep 21 '22 03:09

Nikolay Elenkov