Skip to content Skip to sidebar Skip to footer

Issue In The Assets Folder

I had an issue where a font didnt work and it gave me a FC. So I put the font file into the sdcard, and used CreateFromFile in the typeface and the font worked! Here is the code I

Solution 1:

see this

Typefacefont0= Typeface.createFromAsset(getAssets(),"fonts/AmericanDream.ttf"); 
  tv1.setTypeface(font0);

here fonts (folder in assets) folder containing AmericanDream.ttf file inside. like:assets-->fonts-->AmericanDream.ttf i hope this will help u.

Solution 2:

AssetManagerassetManager1= getApplicationContext().getAssets();
Typefacetf1= Typeface.createFromAsset(assetManager1, "James_Fajardo.ttf");

and used in textview like

urTextView.setTypeface(tf1, Typeface.BOLD);

hope useful for u.

Post a Comment for "Issue In The Assets Folder"