Android provide few fonts like monospace, normal, sans, serif. What if we want to use some custom font that is not present as part of android font.
Here is easy steps to use custom font:
To create assets folder, in Android Studio (1.0 & above), right-click on the app and navigate to the Assets Folder.
In the next screen, just click on finish button to create assets folder.
Result of sample
Android doesn't support for applying fonts across the whole app. Still, there are 4 approach which we can apply to use custom font in whole application with their own pros and cons. These approachs are:
Step 1: Create a new project in Android Studio and name it Custom font in android.
Step 2: Open res -> layout -> activity_main.xml and add following code
Step 3: Create assets folder and put your font there
Step 4: Open your MainActivity.java and onCreate method set your desired font for view. Source of my MainActivity.java is given below:
Step 5: Clean and run the project to see the result.