Yes you can, you cannot define it in xml layouts. You must use it dynamically every time. For example, this tutorial .
If the link is dead, here is the sum of things:
- Get a font file, e.g.
times.otf - Put it in the folder with your resource, in the "fonts" folder
Get a TextView link with something like this:
TextView tv = (TextView) findViewById(R.id.myCustomTVFont);
Take the font from the resource folder:
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/times.otf");
Make your TextView great:
tv.setTypeface(tf);
Sephy Aug 6 2018-10-06 14:09
source share