4

I just created a text page in my app and now i want to change language of this page dynamically to Indian languages like Telugu, Tamil, Bengla, Guujrati and Punjabi.

I researched a lot, and got that there are only 2 methods to achieve this(please correct me if i am going wrong):-

1)Using localization of strings http://developer.android.com/guide/topics/resources/localization.html . But in it problem is that, if android phone is supportable with these languages then it works otherwise it show boxes in-place of fonts.

2)Using custom fonts to change language like

 TextView tv=(TextView)findViewById(R.id.custom);
 Typeface face=Typeface.createFromAsset(getAssets(),"fonts/Verdana.ttf");
 tv.setTypeface(face);

But here's the problem is rendering. Fonts are not rendered properly.

Please suggest me, which option should i choose and how to overcome it's limitation.

I also want to mention that I want to support it on Android 2.3 and above.

Praful Bhatnagar
  • 7,425
  • 2
  • 36
  • 44
Manish Kumar
  • 1,095
  • 9
  • 19

1 Answers1

0

Prior to Android 3, you need to use an appropriate font plus localisation to display characters from special scripts.

For Android 3+, using localisation most times is sufficient. Exceptions are Arabic, Hebrew, Indic scripts and a few others where you may need an appropriate font in addition to localisation to properly display these special characters in your Android app.

AFAIK, Verdana ONLY supports European Scripts such as Latin-1, Latin Extended-A, Latin Extended-B, Latin Extended Additional, Basic Greek and Cyrillic. Whereas Telugu, Tamil, Bengali, Gujarati are part of the South Asian Scripts - not sure about Punjabi (See Unicode Consortium for more info regarding Unicode scripts.) I guess you need to find an open-source font (so you don't have to pay loyalty when using proprietary fonts) that support the scripts you want to implement in your app.

ChuongPham
  • 4,761
  • 8
  • 43
  • 53