2013-03-19 47 views
6

enter image description here乌尔都语字体

我已经在的TextView设置乌尔都语和应用乌尔都语字样,但只显示一个字一个字像ب ہ ن

这里是代码:

Typeface tf1 = Typeface.createFromAsset(this.getAssets(), "Urdu.ttf"); 
      TextView textView = (TextView)findViewById(R.id.textView1); 
      textView.setTypeface(tf1); 
      textView.setText("یہ انگریزی نہیں"); 
+0

我测试2.2 – 2013-03-19 05:58:04

回答

5

Asaalam-o-alakum bibi Tahira 您可以从此链接下载urdu Font ,我已经测试过它。

感谢

+0

a as aslam让我试试看。 – 2013-03-19 06:37:17

+0

这应该是一个评论 – 2013-03-19 06:41:11

+0

@furqi它仍然是相同的,即时测试2.2和2.3.1,其显示良好的4.0。 – 2013-03-19 06:45:05

1
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("یہ انگریزی نہیں"); 
+0

我正在从数据库中获取数据,并需要在textview中显示urdu中的数据,可能需要在SQlite中将其放入urdu中?以及如何可以显示在urdu字体在textview android请帮我 – Erum 2014-02-25 20:20:10

+0

上面的代码是从资产文件夹中获取字体,你必须检查此链接http://stackoverflow.com/questions/16306702/reading-data-from-sqlite -database-in-android-application – 2014-02-26 08:39:19

+0

http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ – 2014-02-26 08:39:55

2

区域的语言,你需要阅读他们为UTF-8,然后设置字体。

我按照下面的步骤,工作正常。

  1. 以ms-word复制样本URDU文本。检查它的字体。

  2. 复制资产中的字体。

  3. 将textview文本设置为UTF-8
  4. 应用Assets中的字体。
相关问题