How to use custom font in a project written in Android Studio

Asim Roy picture Asim Roy · Dec 21, 2014 · Viewed 345.5k times · Source

I was trying to use custom font in Android Studio as we did in Eclipse. But unfortunately could not figure out where to put the 'assets' folder!

Answer

Asim Roy picture Asim Roy · Dec 21, 2014

Update 2020:

Create a folder named font inside the res folder and copy your font

enter image description here

<TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fontFamily="@font/abc_font" />

For programmatic use:

textView.setTypeface(ResourcesCompat.getFont(context, R.font.abc_font))