How to use custom font in Android Studio
- Go to the (project folder)
- Then app>src>main
- Create folder 'assets>fonts' into the main folder.
- Put your .ttf file into the fonts folder.
AssetManager am = context.getApplicationContext().getAssets(); typeface = Typeface.createFromAsset(am, String.format(Locale.US, "fonts/%s", "abc.ttf")); setTypeface(typeface);
or try this way:TextView tx = (TextView)findViewById(R.id.textview1); Typeface custom_font = Typeface.createFromAsset(getAssets(), "fonts/abc.ttf"); tx.setTypeface(custom_font);
EmoticonEmoticon