Rendering HIndi font on Android 2.3 and lower

怎甘沉沦 提交于 2019-12-08 02:05:14

问题


I am developing an android App in Hindi but find that few characters are misspelled and broken in Hindi the issue is in http://code.google.com/p/ankidroid/issues/detail?id=1008 but no solution there दिप is rendered as दपि letters in hindi font above are formed as द + ि + प which should display as दिप but It render as दपि The same question was put earlier but not resolved so I had to repost it again Correcting Hindi (Unicode) rendering in Android


回答1:


Finally I found the solution this is very simple just import the font in my case I am developing web app

@font-face { font-family: hindi; src: url('fonts/k010.TTF'); } body,h1,h2{ font-family:hindi; }

then type text in your a text editor or MS-word using Kruti devi10 font after You finished change the font to Arial and paste the text in your web App and it will render perfectly




回答2:


you can use Unicode ...

TextView tv=(TextView)findViewById(R.id.textViewmyView);

final Typeface tf = Typeface.createFromAsset(this.getAssets(), "Hindi-SARAL1.TTF");

tv.setText(Html.fromHtml("&# 2367;&# 2342;&# 2346;"));

tv.setTypeface(tf);

unicode value continues no gap.....

and you can also convert world to unicode via this site...http://mylanguages.org/converter.php but in case of इ 1st use unicode of इ then alphabets Unicode...b/c till android version 4.0 Hindi Unicode not supported proper..



来源:https://stackoverflow.com/questions/15454596/rendering-hindi-font-on-android-2-3-and-lower

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