1

How To add typeface in eclipse so that we can use in our application. I have read that provided typeface in inbuilt typeface for android

http://developer.android.com/reference/android/graphics/Typeface.html Typeface Static fields.

Is there any way to add typeface hereenter image description here

shailesh
  • 1,783
  • 2
  • 17
  • 26

1 Answers1

0

I used my own font in the android application as follows,

Put the font file .ttf into the assets folder.

then create the object of typeface as,

mTypeface = Typeface.createFromAsset(getAssets(), ttfFileName);

And then set the type face to UI elements as,

findViewById(R.id.nameTextView).setTypeface(mTypeface, Typeface.BOLD);
RootCode
  • 569
  • 7
  • 12
  • My Question is **How could you set this typeface in xml like the image** – shailesh May 22 '13 at 12:50
  • Directly through XML is not possible. You have to write custom component. Refer [this](http://stackoverflow.com/questions/2973270/using-a-custom-typeface-in-android) – RootCode May 23 '13 at 11:39