开发者

Typing Urdu/Arabic in TextEdit/TextView in Android

开发者 https://www.devze.com 2023-04-08 05:00 出处:网络
I want to create a database in which i can add and retrievethe 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 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 g开发者_开发百科ot Exception that Native Font.....


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消