HOW TO ADD CUSTOMISED TEXT FONT IN ANDROID

By default, Android consists only three fonts namely monospace, serif and sans serif. You can change the font in XML by using android:typeface=”” but unfortunately you can’t add custom font this way.

To add your custom font in your Android project, you first need to create ‘assets’ folder in your project. To create, just use the file explorer of your PC and navigate to Android project folder and then create a folder named assets inside project folder>app>src>main.

Also, create a new folder named ‘fonts’ inside your assets folder. Copy paste your font file into the fonts folder. Now, open your project in Android Studio and add the code as given below.

 

 

The font change may not reflect on your Android Studio preview, hence make sure the font is changed by running the app on any device or emulator.

 

Leave a Reply