2012-07-03 37 views
0

您好,我想在android中測試印度語的本地化。 以下是值的文件夾string.xml 印地語字體不能在Android中正確呈現

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

我使用AndroidHindi.ttf字體。

我想在adnroid中顯示印地文中的特定文本,但是在運行時,我得到了未渲染的文本。

我應該包括哪個特定的庫來正確顯示它。

回答

1

您必須下載您的語言字體文件(.ttf)並放入資產文件夾。

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