Ian Vink
Ian Vink

Reputation: 68830

android:textAppearance for Arabic

The default font in a TexView renders Arabic horribly.

Is there a way I can set TextView to a style that will render Arabic nicely, perhaps using android:textAppearance?

Upvotes: 0

Views: 1554

Answers (1)

Ali Behzadian Nejad
Ali Behzadian Nejad

Reputation: 9044

Create a typeface and set it to all components that display text (TextView, EditText, Button, ...). To do this:

1- Copy your font file into your assets folder

2- In your Activity:

someTypeFace = Typeface.createFromAsset(getAssets(), "fonts/someFont.ttf");

3- Everywhere you have a View object:

someTextView = (TextView) findViewById(R.id.some_text_view);
someTextView.setTypeface(someTypeFace);    

Upvotes: 1

Related Questions