tamil unicode font text scrambles/broken in android

巧了我就是萌 提交于 2020-01-05 08:03:32

问题


i need to use unicode font in android instead of bamini. I don't want to use script to convert to & from bamini to unicode.

Typeface fontface2 = Typeface.createFromAsset(this.getAssets(), "fonts/Lohit-Tamil-Classical.ttf");
playBtn.setTypeface(fontface2);
//playBtn.setText(UnicodeUtil.unicode2tsc(getContext().getString(R.string.QUIZ)));
playBtn.setText(Html.fromHtml(getContext().getString(R.string.QUIZ)));

it render tamil but the characters are scrambled. Please help to fix.

Thanks

Mahir


回答1:


If the phone doesn't support Unicode Tamil (before ICS aka 4.0) then you can't display Unicode scripts. Basically utill Jelly Bean, Android doesn't have proper Tamil rendering support (even though first it made available in 4.0). So basically no matter what Unicode font you use, Android OS doesn't know how to shape it up and show it.

That's why people use TypeFace and non unicode fonts such as Bamini and Mylai (TSCII font).

Read my elaborative answer and solutions here



来源:https://stackoverflow.com/questions/11725310/tamil-unicode-font-text-scrambles-broken-in-android

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