Android: unable to show correct hindi words

匿名 (未验证) 提交于 2019-12-03 10:10:24

问题:

I am working in android. I am designing an application which shows Hindi words in text view.

I am using this code.

I used font in my resourses like DroidHindi.ttf, DroidSansFallback.ttf etc. this is showing some words correctly like as So please suggest me what .ttf i should use so each word of Hindi show correctly.

回答1:

@Pushpendra I was having same problem with my testing device (HTC phone). But i tried same app on samsung android phone it works properly on it. So i think you should try your app on different device May be this will help you.



回答2:

Instead of .ttf file, use .otf file.



回答3:

you can use Unicode instead of direct value...

String str="&# 2367;&# 2342;&# 2357;&# 2381;&# 2351;&# 2366;";

continious no gap.

TextView txtview_name=(TextView)findViewById(R.id.textViewmyView);  final Typeface customF = Typeface.createFromAsset(this.getAssets(), "Hindi-SARAL1.TTF");  txtview_name.setText(Html.fromHtml(""+str)); txtview_name.setTypeface(customF);

and you can also convert world to unicode via this site...http://mylanguages.org/converter.php&# 2342;



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!