自定义字体(RTL labguage)问题
根据 android 2.3 此新版本支持一些 RTL 语言,例如阿拉伯语。但是,模拟器无法正确显示字体。在我写的代码中:
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("السلام علیک یا حبیبی");
}
但在输出中它显示分隔的字符而不是连接的字符。
如何连接角色?
According to android 2.3 some RTL languages such as Arabic is supported in this new version. However, emulator does not show the fount correctly. In code I have written:
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("السلام علیک یا حبیبی");
}
but in the output it shows separated characters instead of connected characters.
How can I connect the characters?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
截至目前,只有运行 Android 系统的三星手机支持
bidi
和显示阿拉伯字符。你的代码没有任何问题。打开eb 浏览器并浏览阿拉伯语网站< /a> 您会在非三星手机上看到同样的问题。As of this date only Samsung's phones running on android support
bidi
and display of arabic characters. There is nothing wrong with your code. Open the web browser and browse an arabic website you will see the same problem on non-samsung phones.您可以使用此工具
示例图像:
you can use this tools
sample image: