在 Android 的 TextEdit/TextView 中输入乌尔都语/阿拉伯语
我想创建一个数据库,可以在其中添加和检索乌尔都语单词。为此,我安装了 Inpage 2009 professional 并将其字体(.ttf)复制到资产文件夹中,但出现错误,即 我还安装了 UrduFonts.exe 并复制了其字体 JameelNooriNastaleeq.ttf 但它也给出了相同的错误。我需要与 android 兼容的乌尔都语字体,该字体可以使用 android 在数据库中添加和检索乌尔都语。 这就是我对 Lcd2Mono.ttf 进行编码的方式,我拥有该字体的真实体验,但我不成功。这是我的一段代码..
private EditText txt,start,urdu;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
urdu=(EditText) findViewById(R.id.urdu);
try
{
urdu.setTypeface(Typeface.createFromAsset(this.getAssets(),"urdu.ttf"));
urdu.setText("ur text");
}
catch(Exception ex)
{
start.setText(ex.toString());
}
我用 Inpage Fonts 做了一些,但得到了 Native Font 的异常......
I want to create a database in which i can add and retrieve the Urdu words. for this purpose i installed Inpage 2009 professional and copied its fonts (.ttf) into assets folder but it gave an error i.e
I also installed UrduFonts.exe and copied its font JameelNooriNastaleeq.ttf but it also gave the same error. i need the Urdu font that is compatible to the android , the font that can add and retrieve Urdu to and from the database using android.
this is how i coded foa a Lcd2Mono.ttf and i am having the true experience of that font but i am unsuccessful. here is my piece of code..
private EditText txt,start,urdu;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
urdu=(EditText) findViewById(R.id.urdu);
try
{
urdu.setTypeface(Typeface.createFromAsset(this.getAssets(),"urdu.ttf"));
urdu.setText("ur text");
}
catch(Exception ex)
{
start.setText(ex.toString());
}
i did some with Inpage Fonts and got Exception that Native Font.....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为 JameelNooriNastaleeq.ttf 字体非常大,超过 10M (可能以某种方式与您的问题有关),我建议尝试更小的字体,例如: http://www.quran.or.kr/urdu/font/asunaskh.ttf
但连接乌尔都语字符仍然存在问题,就像这个问题一样:
如何向 android 添加语言支持
你遇到了什么异常?
i think JameelNooriNastaleeq.ttf font is very huge, more than 10M (maybe somehow connected to your problem), i recommend to try something much more smaller like: http://www.quran.or.kr/urdu/font/asunaskh.ttf
but still issue with connecting the urdu characters, like in this question:
how to add language support to android
what exception you got?