Dipaly farsi text in android webview (for phones that do not support Farsi)

In letters, Farsi join together to write scripts. However, when I save HTML pages using "UTF-8" or "Windows-1256" and try to display them using webview in android, the letters expand separately and left-right (instead of RTL). I should note that this case does not occur in phones supporting Farsi.

The correct form should be like this (picture from a phone supporting Farsi):
Sample of right form
Poorly formed text occurs in phones that do not support Farsi (Persian):

Sample of bad-formed display

It should be noted that I used the Persian font in both cases. I also see some solutions for regular strings in java that change the character to one in this question

My question is . Can I fix these cases (or should this be fixed by the phone providers)? if possible, what is the solution?

+4
source share
2 answers

I hit this mistake hard when I made the keyboard. The problem is that the built-in canvas.drawText function in Android did not support RTL languages. There was a patch for him, but it was not part of the default Android build. Thus, only models that go to those parts of the world that used it, as a rule, had it. Unfortunately, I do not know how to check the patch. And if it is not, there is no way to fix it. You might try changing the text, but then you split up the devices that had the patch.

In short, there is no way to fix this. However, I would be shocked if Google had not picked up the patch in the trunk by now (it existed as early as 2.2 days), so its number of phones was reduced.

+1
source

You can try creating html with reverse font sequence! just write a Windows application to get the font and deliver the reverse, and use it on your Android device.

0
source

All Articles