The Technology Magazine.

Full width home advertisement



Post Page Advertisement [Top]

How to use external Fonts in Android

Android provides very few font styles.So in this post I will show how to use external fonts for the TextViews in our android application.


Create a folder named 'fonts' in the assets folder of the android application.


Download any font in '.ttf' or '.otf'  format and copy it in the fonts folder


Create a layout file and add a TextView in the layout and give it an id to be refered.


In the onCreate method of the Activity file bind the TextView and set the Typeface as shown below

TextView tvWord = (TextView) findViewById(;
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/sample.ttf");

Thats it!!! Run the app in an emulator or a device to see the result.

No comments:

Post a Comment

Dear visitor,
Please do not post spam. All comments will be moderated before approval.

Bottom Ad [Post Page]

| Designed by