jfx icon indicating copy to clipboard operation
jfx copied to clipboard

8330559: Trailing space not rendering correctly in TextFlow in RTL mode

Open karthikpandelu opened this issue 1 year ago • 9 comments

The issue is specific to Mac. The glyph positions returned from native side for complex text is not handled in the text render logic. This issue is observed only when trailing spaces are present along with LTR text mixed with RTL text (Example: "Arabic: العربية").

Made changes in getPosX of TextRun class to handle negative values.

Tested the changes manually with the sample code present in the bug and using the MonkeyTester.


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8330559: Trailing space not rendering correctly in TextFlow in RTL mode (Bug - P3)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1468/head:pull/1468
$ git checkout pull/1468

Update a local copy of the PR:
$ git checkout pull/1468
$ git pull https://git.openjdk.org/jfx.git pull/1468/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1468

View PR using the GUI difftool:
$ git pr show -t 1468

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1468.diff

Webrev

Link to Webrev Comment

karthikpandelu avatar May 31 '24 14:05 karthikpandelu

:wave: Welcome back kpk! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar May 31 '24 14:05 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar May 31 '24 14:05 openjdk[bot]

Webrevs

mlbridge[bot] avatar May 31 '24 14:05 mlbridge[bot]

Seems to work with the example in the ticket and the TextArea in the Monkey Tester. No ill effects on Windows. (Did not test it on Linux)

I tested the issue on Linux. It is not reproducible. So this is specific to Mac only.

Could you come up with a unit test?

I couldn't find a way to write unit test for this. I will explore more to find out if it is possible. Please let me know if you have any idea regarding this.

karthikpandelu avatar Jun 04 '24 05:06 karthikpandelu

Fixed the issue in CTGlyphLayout. @andy-goryachev-oracle , @hjohn please re review

karthikpandelu avatar Jun 06 '24 14:06 karthikpandelu

Found another problem: the offset of the whole string appears to be incorrect after the fix:

Screenshot 2024-06-06 at 09 50 35

The code to reproduce was

        flow = new TextFlow(
                t("Arabic:", Color.RED),
                t("   ", Color.YELLOW),
                t("العربية", Color.GREEN),
                new Text("\n"),
                t("Hebrew: ", Color.BLUE),
                t("עברית", Color.BLACK));

andy-goryachev-oracle avatar Jun 06 '24 16:06 andy-goryachev-oracle

The code to reproduce was

        flow = new TextFlow(
                t("Arabic:", Color.RED),
                t("   ", Color.YELLOW),
                t("العربية", Color.GREEN),
                new Text("\n"),
                t("Hebrew: ", Color.BLUE),
                t("עברית", Color.BLACK));

I can see issue with this example. I have to check this case.

karthikpandelu avatar Jun 07 '24 07:06 karthikpandelu

As I will not be able to work actively on this, converted to draft

karthikpandelu avatar Jun 10 '24 19:06 karthikpandelu

@karthikpandelu This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Aug 05 '24 23:08 bridgekeeper[bot]

@karthikpandelu This pull request has been inactive for more than 16 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

bridgekeeper[bot] avatar Oct 01 '24 00:10 bridgekeeper[bot]