Use external fonts in android

mudit picture mudit · Sep 15, 2009 · Viewed 84k times · Source

I want to use external fonts in my app. I have tried adding new fonts using AssetManager but it did not work. Below is my code:

Typeface face;

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

textview.setTypeface(face);

but its not showing the text...

Please help me with this.

Answer

CommonsWare picture CommonsWare · Sep 16, 2009

AFAIK, Android does not support OpenType. Use a TrueType font instead.


UPDATE: Apparently OpenType is now supported, at least somewhat. It was not supported originally, so you will want to test your font thoroughly on whatever versions of Android your app will support.