I applied a custom font to a TextView
, but it doesn\'t seems to change the typeface.
Here is my code:
Typeface myTypeface = Typeface
The best way to do it From Android O preview release is this way:
It works only if you have android studio-2.4 or above
R.font.dancing_script
, R.font.la_la
, and R.font.ba_ba
.Next we must create a font family:
Enclose each font file, style, and weight attribute in the font tag element. The following XML illustrates adding font-related attributes in the font resource XML:
Adding fonts to a TextView:
As from the documentation
Working With Fonts
All the steps are correct.