I am using Android Studio and I have the following code:
Typeface customTypeface = Typeface.createFromAsset(getAssets(), "micra.ttf");
Which executes perfectly when my .ttf
file is under the assets folder. But when I make a folder assets/fonts
, move the .ttf
file to that folder and try the following code:
Typeface customTypeface = Typeface.createFromAsset(getAssets(), "fonts/micra.ttf");
The application crashes.
What is the problem here? Should I replace the /
symbol with something else? My assets folder is under app/src/main.