In your custom apps you will most probably want to use your own font. This post will show you how you can do so. This is a simple example... create a folder in the root of your project called assets/fonts/ then paste the TTF font file (in this case Devanagri.TTF). Then, if you want to apply that font to, say a TextView, do the following
TextView tv = (TextView ) findViewById(R.id.textView);
Typeface face=Typeface.createFromAsset(getAssets(),"fonts/hindi.ttf");
tv.setTypeface(face);
tv.setText("Hindi font");
No comments:
Post a Comment