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

RTL text not working since Eclipse 4.17 (Archi 4.8+) #796

Closed
Alon-fnx opened this issue Jan 5, 2022 · 68 comments
Closed

RTL text not working since Eclipse 4.17 (Archi 4.8+) #796

Alon-fnx opened this issue Jan 5, 2022 · 68 comments

Comments

@Alon-fnx
Copy link

Alon-fnx commented Jan 5, 2022

Bug report

Version of Archi

4.9.1

Archi Plug-ins

Collaboration

Operating System

Win10

Expected Behaviour

Text in shape should support RTL text

Actual Behaviour

Words written in Hebrew in shapes are written in LTR order
For example, If I type
שלום עולם
It shows:
עולם שלום

Steps to Reproduce the Behaviour

  1. Edit a diagram shape
  2. Enter a sentence in Hebrew
  3. The shape shows the words in opposite order
@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

1
2

@Alon-fnx Alon-fnx closed this as completed Jan 5, 2022
@Alon-fnx Alon-fnx reopened this Jan 5, 2022
@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

Samples

@Phillipus
Copy link
Member

Phillipus commented Jan 5, 2022

I don't know what the level of support for RTL text is in Eclipse based apps. I Googled the issue and found that one can add the following two lines to the Archi.ini file:

-dir
rtl

As this is an open source project please feel free to investigate the issue further (Google search is a good start)

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

Thanks for the fast response.

The strange thing is that in previous versions, this problem did not exist...
I'll try and notify.

@Phillipus
Copy link
Member

The strange thing is that in previous versions, this problem did not exist...

Is RTL working in, for example, a single line text control like "Name"?

Things that changed between Archi 4.8.1 and 4.9.x:

Eclipse 4.18 -> Eclipse 4.21
We forked the Eclipse GEF and Draw2d frameworks

You could try Archi 4.9.2 beta (uses Eclipse 4.22) https://www.archimatetool.com/beta/

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

The problem is happening even in a single line of text - as shown in the example.
I'm talking about versions 4.4 / 4.7 and before

I'll try the beta

@Phillipus
Copy link
Member

Phillipus commented Jan 5, 2022

I'm not asking about the text in a diagram figure. I mean single line text controls as in the Properties tab or the controls in the Preferences dialog.

You could also test against Archi 4.8.1 - https://www.archimatetool.com/archive/

Please use the portable zip file versions for testing.

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

In any other object (Properties, diagram name etc'.) it's ok.
It happens only in diagram objects

@Phillipus
Copy link
Member

So we need to narrow it down to what version of Archi this problem is in, and perhaps whether it's a configuration issue for your setup.

  • Try Archi 4.8.1
  • Try a different machine/configuration
  • Any other Archi users have this problem?
  • Is it an Eclipse version issue?
  • Is it something we broke? (for example, we use our own GEF / Draw2d libs)

@Phillipus
Copy link
Member

Help me to understand this better...

As you type in the diagram text box the direction is correct? It's only when you finish editing that the displayed direction is wrong?

But please try to narrow it down to when this bug started.

@Phillipus
Copy link
Member

And does this happen in Note text box?

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

When narrowing the box for one word at a line, It is OK. It shows the words as they ere typed.
In note shape It is the same - when expanded it's reversed, and when narrowing the box it is shown OK..

@Phillipus
Copy link
Member

What do you mean "narrowing the box"? Do you mean when the edit box is shown?

Please try all controls - Notes, Group, Stickies, Canvas blocks, stickies etc.

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

"Narrowing the box - i.e. changing the box width

@Phillipus
Copy link
Member

"Narrowing the box - i.e. changing the box width

Now I'm even more confused. Are you saying that the direction of text changes when you resize a diagram box? Is it correct? Not correct? When you edit a box? Or what? Please provide the exact steps to reproduce this.

Also, please try Archi 4.8.1. Without knowing when this issue started I'm having a hard time to help.

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

22
44
33
11

@Phillipus
Copy link
Member

And please answer this question:

As you type in the diagram text box the direction is correct? It's only when you finish editing that the displayed direction is wrong?

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

Correct.
Edit pane is OK,

@Phillipus
Copy link
Member

And please can you answer the questions for Archi versions:

Archi 4.7.1 - works OK? Not OK?
Archi 4.8.1 - works OK? Not OK?
Archi 4.9.2 beta - works OK? Not OK?

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

If I recall, the last version I had installed was 4.7.1 .
In this version it worked OK.

@Phillipus
Copy link
Member

Phillipus commented Jan 5, 2022

Please test 4.8.1 and 4.9.2 beta

https://www.archimatetool.com/archive/

@Phillipus
Copy link
Member

I have a theory that it might be related to this change:

81ad532

I removed the BlockFlow container.

If this is the cause then it means that this was working in Archi 4.6 but not 4.7 and later.

@Alon-fnx Can you confirm that it is working in Archi 4.6 but not 4.7.1?

https://www.archimatetool.com/archive/

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

I'd love to, but I'm working in an enterprise that every installation can take days... :(
I'll try my best

@Phillipus
Copy link
Member

I'd love to, but I'm working in an enterprise that every installation can take days... :(
I'll try my best

In that case I can't provide a fix in a beta version, because you wouldn't be able to test the beta version.

@Phillipus
Copy link
Member

Phillipus commented Jan 5, 2022

I've made a test build for Windows on the basis of my theory about a breaking change above:

https://www.archimatetool.com/downloads/beta/Archi-Win64-4.9.2-test1.zip (edit: deleted now)

If it is possible for someone to test this and if it works I can apply the fix.

But without user feedback and testing I am not able to fix or diagnose this issue - all I simply need to know is which version of Archi this worked and which version it broke.

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

I've made a test build for Windows on the basis of my theory about a breaking change above:

https://www.archimatetool.com/downloads/beta/Archi-Win64-4.9.2-test1.zip

If it is possible for someone to test this and if it works I can apply the fix.

But without user feedback and testing I am not able to fix or diagnose this issue - all I simply need to know is which version of Archi this worked and which version it broke.

Phillip,
I'm admired by the agility and the swiftness of your response.
I already started to move the wheels.

Thank you - I really do.

@Phillipus
Copy link
Member

Perhaps test on a non-work machine? Or someone else could test?

@Alon-fnx
Copy link
Author

Alon-fnx commented Jan 5, 2022

My other machine is a Linux...
I hope tomorrow I'll have it installed.

@Alon-fnx
Copy link
Author

@Phillipus I'll try

@Alon-fnx
Copy link
Author

@Alon-fnx

Perhaps you can help to test a special build of Archi that is built using Eclipse 4.15?

As you say that RTL is working in Archi 4.7.1 which is built on Eclipse 4.15.

It is a buggy build, errors will be written to the log, and it will leak memory...but it will show whether the RTL bug is in Eclipse or not:

https://www.archimatetool.com/downloads/beta/Archi-Win64-4.9.2-testbuild.zip

Perhaps you could launch it and do a quick test?

Don't use it for production work!

Hi Phil,

The Hebrew is correct.

Does it mean it's an Eclipse bug?

@Phillipus
Copy link
Member

@Alon-fnx Thanks for testing that build.

Does it mean it's an Eclipse bug?

Yes, I think so.

The test build uses all of the code as used in Archi 4.9.2 (apart from having to change the calls to Eclipse's Colorobject for backward compatibility). The only difference is that it is built using Eclipse 4.15 (as used in Archi 4.7.1).

This tells me that there's nothing in Archi's code that can be changed and that we should look to this possible bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=566914

@Phillipus
Copy link
Member

...and for the Eclipse developers to even look at this Eclipse bug they will need a reproducible test case in Eclipse itself.

@Alon-fnx
Copy link
Author

Thank you.
Please let me know whenever you hear it's done.

@Phillipus
Copy link
Member

Phillipus commented Jan 18, 2022

Thank you. Please let me know whenever you hear it's done.

Unless more Hebrew / Arabic Eclipse users can confirm and have steps to reproduce the bug/regression in Eclipse itself, the devs won't even look at it.

@Phillipus
Copy link
Member

@Alon-fnx A new Eclipse bug has been reported:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=579626

Do you think this could be the cause?

@Phillipus
Copy link
Member

That Eclipse bug fix that might have caused this is for Windows only. @Alon-fnx Can you check whether RTL works in Archi on Linux and Mac?

@Phillipus
Copy link
Member

I think it's likely that the Eclipse bug at 579626 could be the cause. The affected Eclipse class was TextLayout and Draw2d uses TextLayout in its BidiProcessor class for RTL text.

@Phillipus
Copy link
Member

Phillipus commented Apr 9, 2022

@Alon-fnx I've made a test build of Archi 4.9.3 for Windows with a modified TextLayout class. Can you test it and see if it fixes the RTL issue?

https://www.archimatetool.com/downloads/beta/Archi-Modified-4.9.3.zip (edit: deleted now)

@Alon-fnx
Copy link
Author

Hello @Phillipus,

Thanks for your concern.
I'll try the modified version and report.
I don't have access to a mac or Linux,

@Alon-fnx
Copy link
Author

Hi,

Got a 404 error on that link

@Phillipus
Copy link
Member

Phillipus commented Apr 10, 2022

Hi,

Got a 404 error on that link

The link is https://www.archimatetool.com/downloads/beta/Archi-Modified-4.9.3.zip (edit: deleted now)

@Phillipus
Copy link
Member

@Alon-fnx You probably are getting these GH messages via email. Please note that messages may be edited since, so it's better to look at the message here in GH in a Browser.

@Alon-fnx
Copy link
Author

@Phillipus, Works like MAGIC!

@Phillipus
Copy link
Member

Phillipus commented Apr 10, 2022

@Alon-fnx Thanks for testing. This confirms the Eclipse regression.

The fix in Archi involves removing the code that was added in https://bugs.eclipse.org/bugs/show_bug.cgi?id=565526:

https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=bd786bc001096a195a4180b432b5d23d1cfcf3a2

What I did was remove those lines, re-compile the TextLayout class for Windows, and re-add it to the org.eclipse.swt.win32.win32.x86_64_3.119.0.v20220223-1102.jar file which is in Archi's plugins folder.

For anyone else reading this affected by this bug I have uploaded this file here:

org.eclipse.swt.win32.win32.x86_64_3.119.0.v20220223-1102.zip

All you need do is unzip the file and replace the jar file in Archi's plugins folder. Note, this only affects Windows.

Now we need to get the Eclipse people to fix it. So if anyone wishes to add their weight to this:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=579626

@Phillipus
Copy link
Member

That Eclipse bug fix that might have caused this is for Windows only. @Alon-fnx Can you check whether RTL works in Archi on Linux and Mac?

Easy to test by copying and pasting this example text into a Figure or a Documentation or Note field:

جارِ التحميل

@Alon-fnx
Copy link
Author

I don't have an available Mac.
I can try on linux on Wednesday.
The example text isn't required. Hebrew has the same properties.

@Phillipus
Copy link
Member

I don't have an available Mac. I can try on linux on Wednesday.

No need to test, thanks anyway. We now know it's Windows only.

The example text isn't required. Hebrew has the same properties.

This text is the only way I and others can reproduce it simply.

@Phillipus
Copy link
Member

This is being addressed: eclipse-platform/eclipse.platform.swt#37

@Phillipus
Copy link
Member

This has now been fixed in Eclipse. Assuming that there are no other side-effects it will make its way into the next version of Eclipse (4.24) in June 2022.

For Archi, I can build a new version based on Eclipse 4.24 after June providing it doesn't contain any other regressions. In the meantime, I suggest affected users download the jar file in #796 (comment) and replace it.

@Phillipus
Copy link
Member

This has not been entirely fixed. RTL text is not rendered correctly if non-RTL and RTL text is mixed with non-RTL text on the left:

Some mixed text جارِ التحميل

See eclipse-platform/eclipse.platform.swt#37 (comment)

This is being tacked here:

eclipse-platform/eclipse.platform.swt#44

@Alon-fnx
Copy link
Author

This is not a new issue.
I have this problem from the first day using Archi.

@Phillipus
Copy link
Member

This has not been entirely fixed. RTL text is not rendered correctly if non-RTL and RTL text is mixed with non-RTL text on the left:

Some mixed text جارِ التحميل

See eclipse-platform/eclipse.platform.swt#37 (comment)

This is being tacked here:

eclipse-platform/eclipse.platform.swt#44

They fixed that now. 😄

@Phillipus Phillipus changed the title RTL in shape's name field RTL text not working since Eclipse 4.17 (Archi 4.8+) Apr 24, 2022
@Alon-fnx
Copy link
Author

Hello @Phillipus,

Are all RTL problems solved in Archi 4.9.3?

Regards,

Alon

@Phillipus
Copy link
Member

I thought I made this clear in #796 (comment)

@Alon-fnx
Copy link
Author

Thank you

@Phillipus
Copy link
Member

This is fixed in Eclipse 4.25 and Archi 4.10 is built on Eclipse 4.25. So close this.

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

No branches or pull requests

2 participants