On Tue, 7 Mar 2023 19:54:15 GMT, Phil Race <p...@openjdk.org> wrote:

> This fixes an the AIOOBE when finding a line break point in RTL laid out 
> glyphs.
> The comment in the bug report explains how we can end up trying to find an 
> unachievable break point and yet there's no "stop" on the search when we've 
> run out of glyphs so hence the exception.
> 
> The fix uses a different method to choose a break point.
> 
> A system test has been supplied which will fail on macOS (even with standard 
> macOS fonts, not just the Noto Sans Arabic) unless the fix is applied.

Changes requested by angorya (Committer).

The fix introduces another problem, affecting the wrapping of RTL text.  To see 
the issue, use a TextFlow page in the monkey tester with a RTL text (or simply 
place a TextFlow in a SplitPane and reduce the width of the TextFlow.

LTR script seems unaffected.

master branch - wrapping is correct:
![Screenshot 2023-03-07 at 12 25 
01](https://user-images.githubusercontent.com/107069028/223544592-30a70460-aece-4d82-8df8-0dfc4e3824ba.png)

the fix branch - wrapping leaves one character per line:
![Screenshot 2023-03-07 at 12 25 
22](https://user-images.githubusercontent.com/107069028/223544760-ce4ee1b7-557d-4e2e-8a0d-bc77fca850b4.png)

modules/javafx.graphics/src/main/java/com/sun/javafx/text/TextRun.java line 288:

> 286:              */
> 287:             /* Not need to check for compact as bidi disables the simple 
> case */
> 288:             for (int gi = glyphCount; gi <= 0; gi--) {

should we also correct the comment on line 288?

-------------

PR: https://git.openjdk.org/jfx/pull/1055

Reply via email to