Android & Wordpress Help center

Add custom font type in Android

Adding custom font type other than the default – ‘sans’, ‘serif’, ‘monospace’ & ‘normal’ font types is pretty easier than one can think of!

We can start by creating an xml file to place our TextView :

<?xml version=”1.0″ encoding=”utf-8″?>

<LinearLayout xmlns:android=”;

android:text=”This is the Chantelli Antiqua font.”


Here we have a TextView with id ‘custom_font_text’, this has been added as we need to add custom font to this TextView programmatically. Now here is what has to be done next –

1) Download a custom font of your choice- the file will be of the format ttf or otf. For instance here we have used ‘HelveticaNeue-Roman.otf’.

2) Put this file in assets folder of your current project.

3) Use the below mentioned code to use this font in your activity –

TextView myText = (TextView) findViewById(;
Typeface font = Typeface.createFromAsset(getAssets(), “.HelveticaNeue-Roman.otf”);

The above code will set the font typeface for this particular TextView to HelveticaNeue-Roman.


Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: