How to set custom font for my entire application

53 Views Asked by At

I wanted to set custom font for app but I'm receiving an error

I tried to set custom font for my app using the method I saw from google. I added a font resource folder but I got an error saying ' aapt : invalid resource directory name My app/app/src/main/res font ' .Please what do I do?

1

There are 1 best solutions below

3
Giuliano On

after you created your font folder, you have to place your font file into that folder and then reference to that file in your application theme style

so go to themes folder of your project and edit the style for the application theme, adding the item "android:fontFamily"

<style name="Theme.MyApplication"....>
...

<item name="android:fontFamily">@font/myfontname</item>

...
</style>