如何在Android中以Urdu(Jameel Noori Nastaleeq)字体定义空格?

我想这样定义,使用Urdu(Jameel Noori Nastaleeq)字体,像这样的字符串定义< string name =“ spaces”>خوشآمدید< / string>在TextView中

ttf = Typeface.createFromAsset(getAssets(),
            "fonts/Jameel Noori Nastaleeq.ttf");

tvRandomLabel = (TextView) findViewById(R.id.tvRandomLabel);
    tvRandomLabel.setTypeface(ttf);

但是在构建应用程序未显示空格之后,

解决方法:

尝试以下unicode“ No-BREAK_SPACE”:

ttf = Typeface.createFromAsset(getAssets(),
            "fonts/Jameel Noori Nastaleeq.ttf");

tvRandomLabel = (TextView) findViewById(R.id.tvRandomLabel);
    tvRandomLabel.setTypeface(ttf);
    // use this unicode for single space \u00A0
    tvRandomLabel.setText(yourtext+"\u00A0"+your text);

更多Unicode here.

上一篇:android-在字符串中设置自定义字体


下一篇:java-LibgGdx-在AssetManager中加载TrueTypeFont