Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbers inside of a mixed RTL/LTR line cause issues with the layout #37

Closed
hojjatabdollahi opened this issue Nov 8, 2022 · 0 comments · Fixed by #49
Closed

Numbers inside of a mixed RTL/LTR line cause issues with the layout #37

hojjatabdollahi opened this issue Nov 8, 2022 · 0 comments · Fixed by #49

Comments

@hojjatabdollahi
Copy link
Contributor

There is an issue with numbers inside a mixed RTL/LTR sentence. Currently a span only contains a boolean that says if it is RTL or LTR. To get a correct layout we need to also consider the BidiClass. Some Bidi Class values are strong LTR or RTL, but some are Weak or Neutral which means when we are creating the layout although the span might be written LTR for layouting purposes it should be treated as an RTL span (if the surrounding text is also RTL).

The simplest example is numbers. Consider the following example:

The latest version of Pop OS is 22.04. آخرین ورژن سیستم عامل پاپ ۲۲.۰۴ است.

This is currently rendered like this:

farsi

As you can see the numbers in the RTL span are treated as an LTR span which causes the layout to mess up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant