<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
So it seems Swing never calls Java2D's TextLayout.getCaretShapes()
API which is what would provide the split carets.<br>
<br>
Swing's caret is an instance of javax.swing.text.DefaultCaret which
has support for rendering a "flag" that indicates<br>
the direction of the caret bias.<br>
<br>
Split caret is however useful to tell a user where the text of the
other direction would appear.<br>
Otherwise even to someone familiar with editing bi-di text I except
some cases of "oh, why did what I typed appear way over there"?<br>
They might still wonder, but at least they'd know where it was going
to be rendered ahead of time.<br>
<br>
-phil<br>
<br>
<div class="moz-cite-prefix">On 10/18/23 10:47 AM, Andy Goryachev
wrote:<br>
</div>
<blockquote type="cite" cite="mid:MWHPR1001MB21739D37D2ECC5E2F9A1020AE5D5A@MWHPR1001MB2173.namprd10.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:"Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:"Iosevka Fixed SS16";
panose-1:2 0 5 9 3 0 0 0 0 4;}@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}@font-face
{font-family:"\@Yu Gothic";
panose-1:2 11 4 0 0 0 0 0 0 0;}@font-face
{font-family:"Helvetica Neue";
panose-1:2 0 5 3 0 0 0 2 0 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Iosevka Fixed SS16";
color:windowtext;}p.p1, li.p1, div.p1
{mso-style-name:p1;
margin:0in;
font-size:10.0pt;
font-family:"Helvetica Neue";
color:#DCA10D;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}div.WordSection1
{page:WordSection1;}ol
{margin-bottom:0in;}ul
{margin-bottom:0in;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16"">Thank
you, Nir.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16"">Try this
link:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16""><a href="https://web.archive.org/web/20120802192035/http:/developer.apple.com/legacy/mac/library/documentation/Carbon/Conceptual/ATSUI_Concepts/atsui.pdf" moz-do-not-send="true">https://web.archive.org/web/20120802192035/http://developer.apple.com/legacy/mac/library/documentation/Carbon/Conceptual/ATSUI_Concepts/atsui.pdf</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16"">Curiously,
the dual (split) caret capability
<b>is</b> present in java2d, but apparently it is not used
in Swing as far as I can tell:<o:p></o:p></span></p>
<p class="p1"><a href="https://docs.oracle.com/javase/tutorial/2d/text/textlayoutbidirectionaltext.html#moving_carets" moz-do-not-send="true" class="moz-txt-link-freetext">https://docs.oracle.com/javase/tutorial/2d/text/textlayoutbidirectionaltext.html#moving_carets</a><o:p></o:p></p>
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16"">-andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Nir
Lisker <a class="moz-txt-link-rfc2396E" href="mailto:nlisker@gmail.com"><nlisker@gmail.com></a><br>
<b>Date: </b>Wednesday, October 18, 2023 at 09:15<br>
<b>To: </b>Andy Goryachev
<a class="moz-txt-link-rfc2396E" href="mailto:andy.goryachev@oracle.com"><andy.goryachev@oracle.com></a><br>
<b>Cc: </b><a class="moz-txt-link-abbreviated" href="mailto:openjfx-dev@openjdk.org">openjfx-dev@openjdk.org</a>
<a class="moz-txt-link-rfc2396E" href="mailto:openjfx-dev@openjdk.org"><openjfx-dev@openjdk.org></a><br>
<b>Subject: </b>Re: [External] : Re: Question: bidi
navigation<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">I've never seen this dual caret
system. The link you gave leads to a 404 error.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I can't comment as to the plan
without knowing what Prism was designed to do, but
it's rather unusual. The logical navigation choice
seems correct regardless.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, Oct 17, 2023 at 7:13 PM
Andy Goryachev <<a href="mailto:andy.goryachev@oracle.com" moz-do-not-send="true" class="moz-txt-link-freetext">andy.goryachev@oracle.com</a>>
wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">Dear Nir:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">Thank you so much for
the information. I spoke to several people
none of whom, unfortunately, use an
environment configured for RTL mode (but who
have keyboard settings for RTL languages).
Based on the very small sample, it appears
that logical navigation is a way to go - which
means the FX behavior (or rather lack thereof
due to
<a href="https://bugs.openjdk.org/browse/JDK-8296266" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.openjdk.org/browse/JDK-8296266</a>)
needs to change relative to jfx8.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">Regarding the
direction indicator - FX implements a dual
caret the logic of which I am still trying to
decipher:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""><img style="width:3.75in;height:.7083in" id="m_7862524550394022718Picture_x0020_1" src="cid:part1.Hbmxy92A.TTQChXi2@oracle.com" class="" width="360" height="68" border="0"></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">(<i>sliptCaret</i> in
PrismTextLayout:354)</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">The closest
description I was able to find is in Apple
ATSUI Programming guide</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""><a href="https://urldefense.com/v3/__http:/developer.apple.com/legacy/mac/library/documentation/Carbon/Conceptual/ATSUI_Concepts/atsui.pdf__;!!ACWV5N9M2RV99hQ!LM7co48XfI4StmMZQ9TBX3emuN_Y_WM2CEdQi3PZQQ7LfjCCzhZRd1m4jTSc2n4tv6lQD49_YAhItF5cU8ZH$" target="_blank" moz-do-not-send="true"><span lang="FR">http://developer.apple.com/legacy/mac/library/documentation/Carbon/Conceptual/ATSUI_Concepts/atsui.pdf</span></a>
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">on page 35, though I
am not sure FX works as described in that
document.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">The expectation is
that the primary (high) caret is where the
character having the same directionality as
the “primary line direction” is inserted. It
is possible that the text layout determines
the primary line direction based on the text
as opposed to taking a hint from
NodeOrientation.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">Since this behavior
is baked into FX prism text layout, I think
it’s unlikely to change.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">To summarize, I think
we should switch FX TextInputControl hierarchy
to logical navigation. What do you think?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">-andy</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span dir="RTL"></span><span dir="RTL"></span><span dir="RTL" lang="HE"><span dir="RTL"></span><span dir="RTL"></span> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<div id="m_7862524550394022718mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Nir
Lisker <<a href="mailto:nlisker@gmail.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">nlisker@gmail.com</a>><br>
<b>Date: </b>Tuesday, October 17, 2023
at 03:44<br>
<b>To: </b>Andy Goryachev <<a href="mailto:andy.goryachev@oracle.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">andy.goryachev@oracle.com</a>><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">openjfx-dev@openjdk.org</a>
<<a href="mailto:openjfx-dev@openjdk.org" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">openjfx-dev@openjdk.org</a>><br>
<b>Subject: </b>Re: [External] : Re:
Question: bidi navigation</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I have just
tested on Win10: Notepad, Wordpad, MSWord
2021, Discord desktop, WhatsApp desktop,
Opera, Eclipse, Gimp 2, Audacity 2.1.3,
and MS VisualStudio 2022 all use logical.
Edge uses logical in text areas and text
fields, but visual in the address bar
(seems like a bug, but you can't have
spaces in web addresses anyway). I don't
remember ever using a visual navigation
application, maybe it was very long ago.
If there ever was a decision there, it was
made long ago, at least on Windows.<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">It's very
important to show the cursor direction
because it resolves ambiguities. It's
available in most applications.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">My Windows UI
is in standard English LTR. I just have
an RTL language installed.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Logical
navigation is a bit easier to work with
I think. The behavior at the edge of a
word that changes the direction can be
surprising (see the ambiguities above),
but that can be helped with the cursor
direction indication. If we can do a
custom implementation, I would go a step
further and actually resolve the
position ambiguities by positioning the
cursor in accordance with the selected
insertion method (RTL or LTR). This
means that the cursor will jump when
switching the language, but it will make
life easier because you will easily know
in which direction you're about to type.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Mon, Oct
16, 2023 at 6:16 PM Andy Goryachev <<a href="mailto:andy.goryachev@oracle.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">andy.goryachev@oracle.com</a>>
wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">Nir, thank you for
responding!</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">The behavior you
describe (“logical” navigation)
is what can be seen in many, but
not all applications, and that
is what puzzles me. What’s more
interesting, the applications
that use a “visual” kind of
navigation, that is the RIGHT
ARROW key always moving the
cursor right regardless of the
text, is used by javafx8 (it’s
totally broken in jfx17, but it
looks from the code that it is
supposed to be the same as in
javafx8), java swing, MS Word
2007 on Windows 10, macOS Notes
app, macOS TextEdit, and Mozilla
Thunderbird. Also, this is the
kind of navigation that some
users prefer (based on a very,
very limited sample I was able
to contact).</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">What puzzles me is
that there is no apparent
standard even among the modern
applications (bundled macOS
apps), although the transition
from visual to logical
navigation in MS Word might
indicate that the logical
navigation is winning.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">The appearance of
caret is another aspect that
seem to have no standard. In
many apps the caret does not
change at all, very rarely we
see a flag indicating direction
(java swing), and only javafx8
and some obsolete mac Carbon
reference doc shows a split
caret.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">More questions for
you:
</span><o:p></o:p></p>
<ol type="1" start="1">
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
<span style="font-family:"Iosevka Fixed SS16"">it looks like you are
on Windows, and are you using
(or have you seen) a fully
localized version of Windows
with all the UI set to RTL
mode?</span><o:p></o:p></li>
<li class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;mso-list:l0 level1 lfo1">
<span style="font-family:"Iosevka Fixed SS16"">Have you seen any
native applications that use
the visual navigation model?</span><o:p></o:p></li>
</ol>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">Getting back to the
problem at hand: if we were to
retain the backward
compatibility in FX, we would
need to fix the “visual”
navigation. FX uses the split
caret which some users find
confusing but we probably are
stuck with it. If we were to
assume that the “logical”
navigation is a standard
everyone is slowly converging
to, then my fix for
<a href="https://bugs.openjdk.org/browse/JDK-8296266" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.openjdk.org/browse/JDK-8296266</a>
is the right one and we should
declare a change in behavior.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">What do you think?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">P.S. I wonder if the
logical navigation was chosen
because of ease of
implementation, or is there a
deeper reason?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<div id="m_7862524550394022718m_-1725203049216495700m_3229193245499694327mail-editor-reference-message-container">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Nir Lisker <<a href="mailto:nlisker@gmail.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">nlisker@gmail.com</a>><br>
<b>Date: </b>Monday,
October 16, 2023 at 04:52<br>
<b>To: </b>Andy Goryachev
<<a href="mailto:andy.goryachev@oracle.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">andy.goryachev@oracle.com</a>><br>
<b>Cc: </b><a href="mailto:openjfx-dev@openjdk.org" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">openjfx-dev@openjdk.org</a> <<a href="mailto:openjfx-dev@openjdk.org" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">openjfx-dev@openjdk.org</a>><br>
<b>Subject: </b>[External]
: Re: Question: bidi
navigation</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">This is a
tricky one. All applications
I have seen, and I think
that's what people expect,
is that the cursor changes
direction during traversal.<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">A key point
is where the paragraph is
aligned to (in Windows
adjusted with left
CTRL+SHIFT and right
CTRL+SHIFT). This sets the
forward and backward
direction: if the
paragraph is left-aligned,
pressing the right
arrow moves the cursor
forward, and for a right
aligned, the right arrow
moves the cursor backward.
Then the actual movement
of the cursor is relative
to the paragraph
alignment: in RTL
alignment, traversing RTL
text moves the
cursor forward, while
traversing LTR moves the
cursor backward.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Examples<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">In
a left-aligned paragraph,
pressing the right arrow
will move the cursor (|)
like this:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">|ab אבג cd<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">a|b אבג cd<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">ab| אבג cd<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">ab |אבג cd
OR ab אבג| cd
(there is ambiguity
because the space
character can be both
RTL or LTR)<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">ab א|בג cd<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">ab אב|ג cd<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">ab אבג| cd
OR ab |אבג cd<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">ab אבג |cd<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">ab אבג c|d<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">ab אבג cd|<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">To help with
navigation, the cursor has
a line attached to its top
showing which direction
it's facing.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hope this
helps.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">On Thu, Oct
12, 2023 at 3:42 AM Andy
Goryachev <<a href="mailto:andy.goryachev@oracle.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">andy.goryachev@oracle.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">Hi.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">I have a question for
people who
routinely use
right-to-left RTL
languages (Arabic,
Hebrew, etc.):</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-family:"Iosevka Fixed SS16"">What is your
expectation for
navigating text
using left/right
arrow keys when
the text
contains a
mixture of RTL
and LTR?</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">It looks like there
is no standard
when it comes to
modern
applications – see
a small sample:</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""><a href="https://urldefense.com/v3/__https:/gist.github.com/andy-goryachev-oracle/4802f9380fb03ec2be7ac36bd98a2059__;!!ACWV5N9M2RV99hQ!P_TgGd02CrA1gNF2bW5yHBRJHFkdDqluPJmHDwIcAQ-DR_NWNd-JMkTn0x9d1m5azgCucompGMSgi7PqR7TS$" target="_blank" moz-do-not-send="true">https://gist.github.com/andy-goryachev-oracle/4802f9380fb03ec2be7ac36bd98a2059</a></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">In javafx, the
navigation of
bidirectional
(bidi) text might
have been broken
sometime after
jfx8, and even
jfx8 might have
issues, see</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""><a href="https://bugs.openjdk.org/browse/JDK-8296266" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.openjdk.org/browse/JDK-8296266</a></span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">It looks like the
most modern
applications use
logical navigation
and logical
selection (that
is, when
navigating using
left/right arrow
keys, the cursor
position reflects
previous/next
insertion indexes
in the text,
rather than visual
position). This
causes the cursor
to change the
direction of
movement when it
crosses the bidi
boundary. Would
you say this is
the expected
behavior?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16""> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">Thank you</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:"Iosevka Fixed SS16"">-andy</span><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>