开发者

Issue in custom font (RTL labguage)

开发者 https://www.devze.com 2023-01-30 21:43 出处:网络
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:

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

精彩评论

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