Android 以自定义字体发布(RTL labguage)
根据一些RTL语言,例如阿拉伯语在这个新版本中是受支持的。但是,emulator无法正确显示源。在我编写的代码中:Android 以自定义字体发布(RTL labguage),android,right-to-left,Android,Right To Left,根据一些RTL语言,例如阿拉伯语在这个新版本中是受支持的。但是,emulator无法正确显示源。在我编写的代码中: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView txt = (TextView) findViewById(R.id.myText); T
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView txt = (TextView) findViewById(R.id.myText);
Typeface font = Typeface.createFromAsset(getAssets(), "Larabieb.ttf");
txt.setTypeface(font);
txt.setTextSize(26);
txt.setText("السلام علیک یا حبیبی");
}
但在输出中,它显示分离的字符,而不是连接的字符
如何连接字符?截至目前,只有运行android的三星手机支持
bidi
并显示阿拉伯语字符。你的代码没有问题。打开w,您将在非三星手机上看到相同的问题 你可以用这个
示例图像:
您是否已将此“larabib.ttf”粘贴到资产中??????
Tools.fa("سلام علیکم");