I have my own font that I want to use for my app in all layouts, I want to change the default font for my app.
In styles.xml I can use
<item name="android:fontFamily"></item>
to change the change the font, but how do I use my custom font here?
In App -> src -> main, i made a new directory called Assets, then another directory in that one called Fonts, and this is where i placed my custom font.
Is this possible? If so, how?
EDIT
As mayosk said, I added
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
And made a Java Class that extends Application as shown below
public class CustomResources extends Application {
@Override
public void onCreate() {
super.onCreate();
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/din_light.ttf")
.setFontAttrId(R.attr.fontPath)
.build()
);
}
}
But the font is still the same, did I miss something