android Ошибка ForegroundColorSpan с арабской / персидской харекой (اعراب)? - PullRequest
0 голосов
/ 03 августа 2020

enter image description here

Above picture is the way an arabic word with hareka should look but after applying ForegroundColorSpan on the second letter(zamma), like below:

TextView textView = findViewById(R.id.simple_tv);
String text = "گُرگ";
SpannableString spann = new SpannableString(text);
spann.setSpan(new ForegroundColorSpan(0xFFFF0000), 1, 2, 0);
textView.setText(spann, TextView.BufferType.SPANNABLE);

the result I get is like below which changes the placement of that letter(zamma) and I couldn't figure out why and how to fix it, any ideas or hints is appreciated in advance

введите описание изображения здесь

РЕДАКТИРОВАТЬ:

Я просто попробовал альтернативу, установив html на textview, но результат точно такой же

string = "<font color='#FFFFFF'>This is my text </font>" + "<font color='#000000'> Another text </font>";
textView.setText(Html.fromHtml(string));
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...