Using otf type fonts in Android studio

Ganga picture Ganga · May 18, 2016 · Viewed 24.5k times · Source

I see a lot of references for ttf fonts in Android studio but none describe usage of otf type fonts. Is there a way to use otf type fonts as well for Android studio projects?

Answer

Ahmad Aghazadeh picture Ahmad Aghazadeh · May 18, 2016

TTF is always been supported. OTF was later added at least in 1.6 and later, but partially.

Typeface face;

face = Typeface.createFromAsset(getAssets(), "font.otf");

textview.setTypeface(face);

Helpful link : Use external fonts in android

You can convert this page : http://www.ehow.com/how_6192479_convert-dfont-ttf.html , https://onlinefontconverter.com/