textview中的乌尔都语字体

时间:2013-03-19 05:53:16

标签: android textview android-fonts

enter image description here

我已在 textview 中设置了urdu并应用了urdu 字体,但只是逐字显示ب ہ ن

这是代码:

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

3 个答案:

答案 0 :(得分:5)

Assalam邻alaikum 比比塔希拉 您可以从此链接下载urdu Font,我已对其进行了测试。

由于

答案 1 :(得分:2)

对于地区语言,您需要将其读作UTF-8,然后设置字体。

我已按照以下步骤正常工作。

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

  2. 复制资产中的字体。

  3. 设置textview文本时,请将其读作UTF-8
  4. 应用Assets中的字体。

答案 2 :(得分: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("یہ انگریزی نہیں");
相关问题