fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
24.92k stars 1.38k forks source link

Add support for Right to Left text #90

Open andydotxyz opened 5 years ago

andydotxyz commented 5 years ago

We also need to support text that is a combination of LtR and RtL...

See issue #38 for some additional thoughts

javad-majidi commented 2 years ago

i have made a simple farsi/arabic package that solves this issue

andydotxyz commented 2 years ago

There is a lot more involved than just the shaping, which is under way already. We have to handle the aspects of editing among others. But I wonder if the comment may have been automated as it was pasted in to 5 issues in quick succession...

javad-majidi commented 2 years ago

yes but part of this issue is because it can not be viewed at all that can be handled by FYNE_FONT Env and part of it is because it can not be shown properly (even if you reverse the letters you wouldn’t get correct RTL text because some letters needs to be concatenated to others) that my package resolves that and part of it is for RTL support when for example a sentence is Wrapped by its length it breaks naturally that is not handled by anything so far!

andydotxyz commented 2 years ago

I don't disagree with anything you say - but it is a stretch to summarise the whole issue as "solved" by your library.

javad-majidi commented 2 years ago

actually i meant solved for showing RTL languages properly rather than solving RTL support and i’ve sent them to various open issues related to “not showing rtl languages properly” to signify that from now on it can at least be shown correctly! that was my bad to copy and paste without regarding the exact issue’s topic!

Jacalz commented 2 years ago

That kind of mass commenting looks a lot like spam in some ways. Please avoid doing so in the future.

andydotxyz commented 2 years ago

actually i meant solved for showing RTL languages properly

It is also worth noting that we cannot depend on, or use code from, a package with no license (or incompatible). I note also that you extracted the code from a website so I doubt very much that the appropriate copyright/permission is secured that would allow us to use the result.

dweymouth commented 7 months ago

Has RTL support landed upstream in go-text? This could be a good ticket to move into the i18n work plan

dweymouth commented 7 months ago

I got some context from a Supersonic user on how RTL support should work with mixed-script strings. Here is a screenshot from a web UI showing proper RTL in a mixed-script string:

image

And here is how it currently renders in Supersonic:

image

So, within a single string, a substring in an RTL language needs to be rendered in proper RTL order, while the rest of the string remains LTR

andydotxyz commented 7 months ago

Has RTL support landed upstream in go-text? This could be a good ticket to move into the i18n work plan

It is landed and also into the go-text/render package. But it requires work in localisation as well which is super early, so might be tight to get it into the same release/

dweymouth commented 7 months ago

Agree that it might be tight to get in same release, though part of it doesn't require localization I assume? The mixed-string case I described above - it seems that just detecting a substring that's in an RTL script should always be rendered in RTL order regardless of locale/etc.

andydotxyz commented 7 months ago

The always is subjective sadly. The locale info defines the default - so yes it can still matter.

mustafa9514 commented 4 months ago

Please add support for Right to Left text. Arabic letters cannot be displayed.

andydotxyz commented 4 months ago

Please add support for Right to Left text. Arabic letters cannot be displayed.

I replied to the other instance where you added this request https://github.com/fyne-io/fyne/issues/1623#issuecomment-2125615467.

Note that this issue was open for that request already so I don't know what your message added?