Open jsphonorio opened 10 years ago
Just to add some detail. This issue appears in both python 2 and python 3 and on multiple OS(Linux,Windows,Android)
And quick test indicates that neither pygame, sdl2, or pil provider get it right.
Languages such as Tamil require reshaping, a process which is not supported in our current providers. I'm working on a new text provider using Pango as an option to provide this support on Linux (and probably OSX).
That makes sense. Question on on how support works. If it becomes linux compatible, would it continue to work when deployed from my linux box to android? Sorry if a silly questions. Im very new to Kivy.
I think the solution for android would be to have a platform-specific provider that uses whatever android uses to render text. (this is a really interesting page about this https://medium.com/@romainguy/androids-font-renderer-c368bbde87d9)
I am facing same problem. But to write Bengali. Please be refereed to the screenshot to see how Kivy is breaking combined letters.
Here is the code.... https://bpaste.net/show/92402933377e Here are the screenshots...
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
As an additional data point, if it helps, vanilla pillow (PIL) Image, ImageDraw, and ImageFont have the same rendering problems as kivy. However, with libraqm also installed, pillow's renders are correct. Kivy's renders are not changed when libraqm is installed.
Kivy with the pango text backend works fine. In the languages I can read, there aren't any obvious errors. Some mention of the pango backend would be nice to have with reference to the text core, specifically with some mention of the downsides or risks of the experimental backend, iand that the pango backend will likely produce better results with unicode fonts for complex scripts.
It may be noted that the pango backend seems to cause extensive performance degradation relative to the default (sdl?) provider, particularly with large textures.
I have tried the following text render routes :
Here's a screenshot of the test code. The kivy column is rendered normally by the application in Label widgets, all the others are images generated by those libraries and displayed by kivy Image widgets.
The languages marked with a * are ones where I'm not certain the source string is 'correct'. In practice, punjabi and marathi are probably correct as well, and I have no idea about the ones after that.
The code that was used to generate the image is here.
What's the status of this now? Seems to be pending on #4902 which however also seems stale. Tangentially, another data point at https://stackoverflow.com/q/63047020/874188
@pyprof I also need a simple solution for Bangla.
@pyprof Maybe we can use Bangla text after converting to ANSI and use [font] tag.
is there Any solutions ? I am facing same problem with Bengali language .
is there Any solutions ? I am facing same problem with Bengali language .
You can convert unicode Bangla text to ANSI and show them in Kivy. See here https://github.com/MS-Jahan/unicode2bijoy
@MS-Jahan I want other languages also....not only bengali .
@MS-Jahan I want other languages also....not only bengali .
Well, that wasn't a perfect solution. You can also try searching for Unicode to ANSI converter for other languages or create your own. That'll be a temporary solution before we can get any solution from the Kivy Team, I guess.
@MS-Jahan This issue is open from 2014 .I don't know why kivy team not solving this problem.
As mentioned here, this should be fixed once sdl_ttf is released (or someone undertakes to build kivy using the unreleased version of sdl_ttf) because it now can use harfbuzz.
These issues sound very similar to #7227.
It was solved with a new feature added in Kivy 2.2.0 for users of TTF fonts and SDL to display it: Label's font_script_name
I suspect it will solve these problems too - at least in applications where you know that the language will be.
Could any of the people who complained about this problem (@jsphonorio @pyprof @MS-Jahan @Sahil-pixel ) please try setting that value, and telling us if the problem is gone?
I am trying to print in Tamil and running into an issue where Kivy misprints the unicode language. Here is a short script and an Image showing the issue. To show comparison, here is same text print in Pyside and how it looks correctly.
The language combines letters together and sometimes rearranges consonants around vowels. Kivy has trouble parsing this.
These last two pictures just provide another example of a different phrase on a different computer. Same issue.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.