Install External Fonts in your application

by Wednesday, April 04, 2012 0 comments
You need to create fonts folder under assets folder in your project and put your TTF files into it. Then in your Activity onCreate()


Typeface typeface = Typeface.createFromAsset(this.getAssets(), "fonts/Roboto-Bold.ttf");
                                (or)
Context context=this;
Typeface typeface = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Bold.ttf");
//In your TextView
TextView address=(TextView)findViewById(R.id.address); 
address.setTypeface(typeface);

karthik nagarajan

Androider

Welcome to Android-Action Blog. I’m a normal guy, who is passionate about Mobile Coding. Here I am writing about Android. Happy learning

0 comments:

Post a Comment