-1

I would like to use new custom fonts in an android application. please be precise and specific when explaining, i am a newbie. Namely, i would like to let my android application use these new android custom fonts http://developer.android.com/design/style/typography.html. Thank you. please help.

ejobity
  • 305
  • 1
  • 3
  • 13

3 Answers3

17

We can use custom fonts using this way,

TextView txt = (TextView) findViewById(R.id.custom_font);  
Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf");  
txt.setTypeface(font);  

Refer this tutorial for Full knowledge.

Aerrow
  • 12,086
  • 10
  • 56
  • 90
5

You simply need to put the fonts .ttf file in your assets folder and assign it to a text field or anything you want to apply it to in your main activity like this:

TextView txt = (TextView) findViewById(R.id.custom_font);  
Typeface font = Typeface.createFromAsset(getAssets(), "Chantelli_Antiqua.ttf");  
txt.setTypeface(font);  

Here's a great tutorial that will teach you all you need to know about this: http://mobile.tutsplus.com/tutorials/android/customize-android-fonts/

Anup Cowkur
  • 20,443
  • 6
  • 51
  • 84
0

try this links here and here

The .ttf files are used to get different format into our android application. Its a easy way to work with .ttf files. The only thing you need to get is get all the available .ttf files by googling

G_S
  • 7,068
  • 2
  • 21
  • 51