-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Cursor of iText in RTL mode (originX == 'right') #2374
Comments
i don t think right to left text is supported. what language are you using? |
@asturur this fix will let you rtl version |
i cannot see why originX should handle text direction. |
@asturur i use the Hebrew/English languages, when the user want iText with hebrew i set the originX to right, but the cursor still work like left origin. |
Because originX and originY influence just the position where top and left 2015-07-30 13:18 GMT+02:00 yaakov hatam [email protected]:
|
@asturur i will add the "rtl" property and will post my enhancement. |
@kob-e did you ever completed this feature? |
@YaakovHatam @asturur any work progress here? |
no. Sadly no progress on RTL text at all |
The workaround @YaakovHatam was mentioning at the beginning is not RTL right..it's just cursor manipulation to start from right.Even the text-align also does the same,it still have to be implemented like a css |
Hello guyz, i have started to write the RTL version of iText, you can take the dist/favric.rtl.js in my forked repository, after i'll finish i will rewrite it and merge to fabric.js repository. |
Hi @YaakovHatam you may want to open a PR early to gather feedback and comments about the code. Thanks for trying! |
Thanks @asturur -
|
would be great if you share it earlier if you want to contribute it back. When is done and working going back and adapt things to fabricjs style may be hard. |
@asturur I will deal with the RTL issues in the fabric.js . After 3 years of using this amazing library with Hebrew after doing a lot of fixes, I decided to contribute back. |
It will be nice if the users here will give me some test cases |
Looks good, very nice work... |
@YaakovHatam are you going to complete this MR ? |
We merged a basic implementation of RTL. |
Initial support was released in version 4.5.0 |
I am checking with RTL support in fabricjs and its look amazing, but i found one issue when manually set cursor at somewhere in middle in text editing mode and writing text then cursor location is not set properly. |
Can you open an issue with a detailed description and a jsfiddle that show this problem, and this problem only? |
Hello asturur |
From the snippet you created it seems that you are trying to write English (Latin) inside an |
Another issue is when using RTL text and textAlign is 'center' or 'right'. |
Did you try the latest master? i thought we fixed that. |
4.6? yes. |
@asturur it was not fixed. The only way to work with RTL ( |
Hello @asturur I am having issue with charSpacing in hebrew selected texts, after applying charSpacing text got flipped. After upgrading fabricJS to 4.6.0 and using new property direction I am still facing the same issue. FYI, I am using Angular 8 with fabric js in my project. Here is my code that i am using for applying charSpacing. Thank you. |
@YaakovHatam Seems that your link is 404 now😥And I'm still confused whether the text selection problem of rtl text is fixed, as I found I couldn't select some part of a rtl text in fabricjs, because when I click at the middle of such a text the cursor is always at the right. Seems that you're working on the rtl problems and I wonder if this bug is fixed, the information and discussions here on github still confuse me a lot |
@oustr It was a while ago and I don't know where the RTL issue currently stands in the project |
In general RTL is poorly supported. Most of the issue we have is because of the difference firefox and chrome handle the RTL text. |
EDIT (17/05/2020)
Hello guyz, i have started to write the RTL version of iText, you can take the dist/favric.rtl.js in my forked repository, after i'll finish i will rewrite it and merge to fabric.js repository.
https://github.com/YaakovHatam/fabric.js
hello i made quick fix that allow the cursor behave like it should be in Right-to-Left texts.
in the function:
i have replaces the code:
with:
and now it works proper!
add:
and for the selection the change is:
in the function
instead
replace with
The text was updated successfully, but these errors were encountered: