I have added a custom font file to my assets/fonts folder. How do I use it from my XML?
I can use it from code as follows:
TextView text = (TextView) findViewById(R.id.textview03);
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Molot.otf");
text.setTypeface(tf);
Can't I do it from XML using an android:typeface="/fonts/Molot.otf"
attribute?
This question is related to
java
android
xml
android-layout
fonts
Source: Stackoverflow.com