-1

I am developing android application in Marathi language, for that i want to set Marathi font to text view. So please let me know how to set that

Thanking you..

  • The question is answered here for another language http://stackoverflow.com/questions/25052431/how-to-develop-a-complete-malayalam-app/25053518#25053518 – Remees M Syde Jan 22 '15 at 05:59

4 Answers4

1

Put your font in assets folder, then create new Typeface from it

Here is an example

TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface font = Typeface.createFromAsset(getAssets(), "SomeFont.ttf");
txt.setTypeface(font);
Sergey Pekar
  • 8,555
  • 7
  • 47
  • 54
0

First of all put your fonts in assests folder in your project. then in textview in java file where you want to put marathi, use this code:

Typeface mfont = Typeface.createFromAsset(getAssets(), "roboto_light.otf");
<your Textview>.setTypeface(mfont);
kiturk3
  • 549
  • 10
  • 30
0

Download marathi fonts and save it in assests folder and set typeface using that font.

Sample:

TextView textView = (TextView)findViewById(R.id.textview);
Typeface tf = Typeface.createFromAsset(getAssests(), "name_of_font.ttf");
textView.setTypeface(tf);
Amey Haldankar
  • 2,223
  • 1
  • 24
  • 22
0

you need to pass unicode character like\u... to you textview text.

you can use converter to convert the language. Or can take a look http://www.unicodeonline.com/ For getting the exact value you can pass your unicode into ResourceBundle.getBundle(unicodestoragelocation,locale).getString(UnicodeValue)

rab
  • 207
  • 2
  • 6