Ajn Ajn - 11 months ago 108
Android Question

Setting Button text font in android

I have a

created using android widgets. I want to set the font of the button text to
Helv Neue 67 Med Cond
. How to get this font and set it to the button text in android layout file?

Answer Source

First you have to put the ttf file in assets folder and then You can use the below code to set Custom font in TextView, same way you can do for Button:

TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "Helv Neue 67 Med Cond.ttf");