views:

946

answers:

3

How to add additional font in android environment? I need to make a font like LCD with pale background numbers like this:

http://www.androidfreeware.net/img2/gps_speedometer_android_1.png

+4  A: 

You want to use the android.graphics.Typeface class, which can create new Typefaces from assets or files.

Yann Ramin
+3  A: 

We at bangalore android developers group had done this for one of our project AutoMeter You can have a look at the code there in detail.

The code would look something like this

Typeface myTypeface = Typeface.createFromAsset(this.getAssets(),"DS-DIGIB.TTF");
waitingTimeView = (TextView) findViewById(R.id.WaitingTime);
waitingTimeView.setTypeface(myTypeface);

DS-DIGIB.TTF is the font put in the assets folder

the100rabh
Thanks for all it helps me.
A: 

What if I have a bunch of text views, how can I change them all at once (a for loop or something) or, is it even possible?

Orel