i'm trying to display an arabic text (Right to Left) in my app, but i get words displayed left to right in lines.
I'm using an arabic supporting font and arabic reshaper lib. The text is loaded from strings file.
The app support Android 2.1.
Here a screen shot for the result:
For more details:
public class MainActivity extends Activity {
private TextView tvtest = null;
private static Typeface typeface;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tvtest = (TextView) findViewById(R.id.tvtest);
tvtest.setText(ArabicUtilities.reshape(getString(R.string.first_part)));
Typeface tf;
tf = GetFont(getApplicationContext());
tvtest.setTypeface(tf);
}
public static final Typeface GetFont(Context context) {
if (typeface == null) {
typeface = Typeface.createFromAsset(context.getAssets(),
// "DroidSansFallback.ttf");
"MSHQW.TTF");
}
return typeface;
}
}