How (if possible) could I set a custom font in a ActionBar title text(only - not the tab text) with a font in my assets folder? I don\'t want to use the android:logo option.
I just did the following inside the onCreate() function:
TypefaceSpan typefaceSpan = new TypefaceSpan("font_to_be_used");
SpannableString str = new SpannableString("toolbar_text");
str.setSpan(typefaceSpan,0, str.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
getSupportActionBar().setTitle(str);
I am using the Support Libraries, if you are not using them I guess you should switch to getActionBar() instead of getSupportActionBar().
In Android Studio 3 you can add custom fonts following this instructions https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html and then use your newly added font in "font_to_be_used"