mEditText = (EditText) getContentView().findViewById( R.id.custom_text );
AssetManager assests=getContext().getBaseContext().getAssets();
Typeface tf = Typeface.createFr
// try this way,hope this will help you...
1. First of all you have create "fonts" directory under "assets" directory and put you custom fonts file on "fonts" directory.
2. now try to apply this code here i used my custom fonts "Helvetica LT 45 Light_0.ttf"
XML
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:gravity="center">
<EditText
android:id="@+id/edtCusomFonts"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
Activity
private EditText edtCusomFonts;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
edtCusomFonts = (EditText) findViewById(R.id.edtCusomFonts);
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Helvetica LT 45 Light_0.ttf");
edtCusomFonts.setTypeface(tf);
}
Have a try with
mEditText.setTypeface(Typeface.createFromAsset(context.getAssets(),"fonts/DroidSansFallback.ttf"));