Skip to content
This repository has been archived by the owner on Apr 27, 2019. It is now read-only.

Persian or arabic justification issue : reversed words #18

Closed
miladrasooli opened this issue Feb 22, 2014 · 4 comments
Closed

Persian or arabic justification issue : reversed words #18

miladrasooli opened this issue Feb 22, 2014 · 4 comments

Comments

@miladrasooli
Copy link
Contributor

Hi,
I want to use your code for my app that is in Persian language, But when it draws text all the words are in reversed form.I think it is RTL problem that is not considered in the code.
Thanks

@mathew-kurian
Copy link
Owner

The fix should be quite easy. All you have to is basically instead of drawing at horizontalOffset, you draw the text at width - horizontalOffset - wordLength - (and couple other margin offsets). I think should be able to fix this without having to mess with the code too much.

PS. I don't have a unit I can test my code on, so I really can't say too much. However, I can confirm that you modifications should not have to go outside of TextViewEx.java.

If you do get it to work, please do push the code, so that others can use it as well.

@miladrasooli
Copy link
Contributor Author

Hi,
Thank you for your advice... I changed some lines of code and now it is working (only) for RTL languages.
miladrasooli@255d500

@Saleh-Hassan
Copy link

You should try this: https://github.com/Saleh-Hassan/RTL-TextJustify-Android

@mathew-kurian
Copy link
Owner

Just do a pull request and I will merge with the updated code that I will push tomorrow night.

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

No branches or pull requests

3 participants