I have created an android application where I want to display unicoded bengali sentences.
For this I have done the following steps.Step1: I store my bengali开发者_如何学运维 font named Siyamrupali.ttf
in the Assets folder.
Step2: In main.xml file I took a text view where I display characters.
Step3: In my MainActivity. Java I wrote this...
public class mainAc extends Activity
{
AssetManager arabi_font;
TextView tx;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tx=(TextView)findViewById(R.id.tv);
try
{
String str="\u0986";
tx.setTypeface(Typeface.createFromAsset(getAssets(),"Siyamrupali.ttf"));
tx.setText(str);
}
catch(Exception ex)
{
tx.setText("font cannot load: "+ ex.toString() );
}
}
Then output show আ
Which one is correct But When i wrote String str="\u0986\u09AE\u09Bf"
;
In MainActivity. Java
Then output shows আমই
But i should be আমি
What can I do now to solve this problem. Any body give me some advice or link or sample code.
\u0986\u09A\u09BF is not a valid unicode character. I am afraid why you didnot get error. please have a look on the following like
Unicode character of Bengali scripts
Thanks
Android doesn't have full complex text layout support for all of Unicode yet, and Bengali matras are one feature that isn't rendered right. See issue 5925. Sorry!
精彩评论