![enter image description here](https://i.stack.imgur.com/4aT1f.jpg)
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));