drichirich
drichirich

Reputation: 3

Hindi characters not rendered properly in Android

I want to test localization in Indian language in Android. Following is the file string.xml in values folder

<string name="app_name">नमस्ते</string>   
<string name="text_a">परिक्षण</string>

I am using AndroidHindi.ttf font.

I want to display the particular text in hindi in adnroid , but while running I am getting unrendered text .

which particular library should I include to display it properly.

Upvotes: 0

Views: 462

Answers (1)

Umar Mansuri
Umar Mansuri

Reputation: 127

you must download your language font file(.ttf) and put in asset folder.

Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Akshar.ttf");               
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf);
tv.setText("Seasonal messages like welcome (நல்வரவு) is used in Kolam. Volunteering to draw kolam at temple is sometimes done when a devotee's");

Source

Upvotes: 1

Related Questions