Easiest way to use custom fonts? - android

hyuhin

New Member
the way i found for using custom fonts on my android app is using the below code\[code\]TextView txt = (TextView) findViewById(R.id.textView1); Typeface font = Typeface.createFromAsset(getAssets(), "ABCD.TTF"); txt.setTypeface(font);\[/code\]i've stored the ABCD.TTF in assets folder..and ya it works, no probs in tat.. the thing is i have to add the above code for each and every texts,buttons,etc i have.. and its really a time consuming thing if theres lots of texts and buttons in various activity :(what i need is an alternate method to do it, an easiest one to do it..like using a single block of code not repeatative like the above to change the fonts for all the stuffs..else doing it in the xmlor is there any way to add our custom font to the inbuilt typeface where normal,sans,serif,monospace are present.
 
Back
Top