我想这样定义,使用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.