Domanda

In farsi letters are attach together to form writing scripts. However when I save HTML pages using "UTF-8" or "Windows-1256" encdoings, and try to display them using webview in android, letters are diplayed seperately and in left-to-right direction (instead of RTL). I should notice that this case is not happening in phones supporting farsi.

Correct form should be like this (snapshot from phone supporting farsi):
Sample of right form
Bad-formed text happens in phones not supporing farsi (Persian):

Sample of bad-formed display

It should be noticed i've used persian font in both cases. I also see some solutions for normal Strings in java which changes character on by one in this question

My question: Can i fix this cases (or it should be fix by phone vendors)? if possible what is solution?

È stato utile?

Soluzione

I hit this bug a lot when I was doing keyboards. The problem is that the build in canvas.drawText function in Android didn't support RTL languages. There was a patch for it, but it wasn't part of the default build of Android. So only models going out to those parts of the world that used it tended to have it. Unfortunately I know of no way to test whether it has the patch. And if it doesn't, there's no way to fix it. You could try reversing the text, but then you'd break devices which did have the patch.

Long story short- there is no way to fix it. However, I'd be shocked if Google hasn't picked up the patch in mainline by now (it existed back in the 2.2 days), so its a shrinking number of phones effected.

Altri suggerimenti

You can try making html with reverse font sequence! just write a windows app to get font and deliver reverse one, and use it in your android device

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top