Skip to content Skip to sidebar Skip to footer

Android Develop Lcd Font

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_androi

Solution 1:

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

TypefacemyTypeface= 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

Solution 2:

publicvoidsetFontTextView(Context c, TextView name) {
Typefacefont= Typeface.createFromAsset(c.getAssets(),"fonts/Arial.ttf");
name.setTypeface(font);
}

Download Arial font in ttf file formate and put in asset folder. Thats enough.

Solution 3:

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

Post a Comment for "Android Develop Lcd Font"