如何在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.
标签:fonts,font-face,android 来源: https://codeday.me/bug/20191122/2058571.html