开发者

Issue in custom font (RTL labguage)

According to android 2.3 some RTL languages such as Arabic is supported in this new version. However, emulator does not show the fount correctly. In code I have written:

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    TextView txt = (TextView) findViewById(R.id.myText);
    Typeface font = Typeface.createFromAsset(getAssets(), "Larabieb.ttf")开发者_开发知识库;
    txt.setTypeface(font);
    txt.setTextSize(26);
    txt.setText("السلام علیک یا حبیبی");
}

but in the output it shows separated characters instead of connected characters.

Issue in custom font (RTL labguage)

How can I connect the characters?


As of this date only Samsung's phones running on android support bidi and display of arabic characters. There is nothing wrong with your code. Open the web browser and browse an arabic website you will see the same problem on non-samsung phones.


you can use this tools

Tools.fa("سلام علیکم");

sample image:

Issue in custom font (RTL labguage)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜