Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Urdu font in textview

enter image description here

i have set urdu in textview and apply urdu typeface but is only showing word by word like ب ہ ن

here is code :

Typeface tf1 = Typeface.createFromAsset(this.getAssets(), "Urdu.ttf");
            TextView textView = (TextView)findViewById(R.id.textView1);
            textView.setTypeface(tf1);
            textView.setText("یہ انگریزی نہیں");
like image 286
Bibi Tahira Avatar asked Mar 19 '13 05:03

Bibi Tahira


3 Answers

Asaalam-o-alakum bibi Tahira You can downlaod urdu Font from this link,i have tested it.

Thanks

like image 187
Furqi Avatar answered Nov 13 '22 09:11

Furqi


For Regional languages you need to read them as UTF-8 and then set the font.

I have followed the below steps and working fine.

  1. Copy the sample URDU text in ms-word. Check the font of it.

  2. Copy the font in assets.

  3. While setting the textview text read it as UTF-8
  4. Apply the font from Assets.
like image 38
Vishal Avatar answered Nov 13 '22 08:11

Vishal


 Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/burnstown_dam.otf");
    TextView tv = (TextView) findViewById(R.id.CustomFontText);
    tv.setTypeface(tf);


Typeface tf1 = Typeface.createFromAsset(this.getAssets(), "fonts/Jameel Noori Nastaleeq       Urdu.ttf"");
    TextView textView = (TextView)findViewById(R.id.CustomFontText);
    textView.setTypeface(tf1);
    textView.setText("یہ انگریزی نہیں");
like image 1
Muhammad Usman Ghani Avatar answered Nov 13 '22 09:11

Muhammad Usman Ghani