public class MainActivity extends Activity { TextView txt; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); txt = (TextView) findViewById(R.id.textview1); Typeface face = Farsi.GetFarsiFont(this); txt.setTypeface(face); txt.setText(Farsi.Convert("سلام")); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:text="@string/hello_world" /> </LinearLayout>
Typeface face = Farsi.GetFarsiFont(this); txt.setTypeface(face); txt.setText(Farsi.Convert("سلام"));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)