jfx
jfx copied to clipboard
8330559: Trailing space not rendering correctly in TextFlow in RTL mode
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
: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.
❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.
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.
Fixed the issue in CTGlyphLayout.
@andy-goryachev-oracle , @hjohn please re review
Found another problem: the offset of the whole string appears to be incorrect after the fix:
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));
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.
As I will not be able to work actively on this, converted to draft
@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!
@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.