How to use custom Fonts in Android TextView?

Rohit Singh
2 min readSep 21, 2017

--

Follow these simple steps

1) Download .ttf file

Download .ttf file (font style) you want from the internet (Just google it there are plenty of sites which will give you tons of fonts free of cost, example Arial.ttf.

2) Upload your downloaded font file in your local

Now, this is the part you need to be extra careful. You should upload your .ttf file in this folder /app/src/main/assets/fonts/ if you don’t see fonts folder under assets then make a new folder and name it fonts and then paste or drag and drop your .ttf file.

Drag and drop your font file

Now the custom font is available now in your local you can use it anytime.

3) Integrate font into your textView

TextView text;     
Typeface customTypeFace=Typeface.createFromAsset(getResources().getAssets(),"fonts/Oswald-Stencbab.ttf");
text.setTypeface(customTypeFace);`

And you are done!

Learn more about Android apps development from my Github Repository .

Putting up content takes a lot of time and effort 😓.
👏 clap 👏 If you think you learned something from this article.
You can find me on Stackoverflow,Github,and,on Linkedin.
Give feedback and feel free to correct mistakes.

--

--

Rohit Singh
Rohit Singh

Written by Rohit Singh

Android Developer | Arizona State University | NASA Psyche Research Aide

No responses yet