Hesam
Hesam

Reputation: 53600

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.

alt text

How can I connect the characters?

Upvotes: 2

Views: 1010

Answers (2)

seyed
seyed

Reputation: 2055

you can use this tools

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

sample image: enter image description here

Upvotes: 1

Reno
Reno

Reputation: 33782

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.

Upvotes: 3

Related Questions