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

Update 2021:

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

enter image description here

All font names must be only: lowercase a-z, 0-9, or underscore.

<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))

For Android Studio 4.2+ there’s even now a menu option:

enter image description here

Leave a Comment