multiple line

"Yuri D." <[email protected]> Mon, 18 Sep 2017 14:24:36 +0300
Newsgroups gmane.comp.internationalization.fribidi
Message-ID <CAOGDOUte-BpNTo2K_UpUoDR1CapPfBtAyTksLvpyMyVgbPAUGg@mail.gmail.com>
--===============0657220203==
Content-Type: multipart/alternative; boundary="f403045d6f481b7990055974fe4f"

--f403045d6f481b7990055974fe4f
Content-Type: text/plain; charset="UTF-8"

Hi,

I wonder what is the correct input to the FRIBIDI library while parsing the
levels for multiple lines?
Should I send each line separately or I can send all the lines in the same
string?

I'm running the code below:

FriBidiChar* unicodeString = new FriBidiChar[textLength];
FriBidiCharType* bidiTypes = new FriBidiCharType[textLength];
FriBidiLevel* bidiLevels = new FriBidiLevel[textLength];

std::string text = "some.\ncar.\nhere.";

// Convert string to unicode
FriBidiStrIndex len = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8,
text.c_str(), (FriBidiStrIndex)text.length(), unicodeString);

// Get BIDI types
fribidi_get_bidi_types(unicodeString, (uint32_t)text.size(), bidiTypes);

// Get BIDI levels
FriBidiLevel resolveParDir = fribidi_get_par_embedding_levels(bidiTypes,
(uint32_t)text.size(), *FRIBIDI_PAR_RTL*, bidiLevels);

And in the result, I get the BIDI levels below:
2 2 2 2 1 1 0 0 0 0 1 0 0 0 0 0

The question is: why I have a level change for the first '.' but not for
the following '.'?

--f403045d6f481b7990055974fe4f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi,<div><br></div><div>I wonder what is the correct input =
to the FRIBIDI library while parsing the levels for multiple lines?=C2=A0</=
div><div>Should I send each line separately=C2=A0or I can send all the line=
s in the same string?=C2=A0</div><div><br></div><div><p style=3D"box-sizing=
:border-box;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-syste=
m,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;=
Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&qu=
ot;;font-size:14px;margin-top:0px">I&#39;m running the code below:</p><p st=
yle=3D"box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36=
,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,H=
elvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoj=
i&quot;,&quot;Segoe UI Symbol&quot;;font-size:14px">FriBidiChar* unicodeStr=
ing =3D new FriBidiChar[textLength];<br style=3D"box-sizing:border-box">Fri=
BidiCharType* bidiTypes =3D new FriBidiCharType[textLength];<br style=3D"bo=
x-sizing:border-box">FriBidiLevel* bidiLevels =3D new FriBidiLevel[textLeng=
th];</p><p style=3D"box-sizing:border-box;margin-top:0px;margin-bottom:16px=
;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Seg=
oe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;=
Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:14px">std::strin=
g text =3D &quot;some.\ncar.\nhere.&quot;;</p><p style=3D"box-sizing:border=
-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-app=
le-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-seri=
f,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI S=
ymbol&quot;;font-size:14px">// Convert string to unicode<br style=3D"box-si=
zing:border-box">FriBidiStrIndex len =3D fribidi_charset_to_unicode(FRIBIDI=
_CHAR_SET_UTF8, text.c_str(), (FriBidiStrIndex)text.length(), unicodeString=
);</p><p style=3D"box-sizing:border-box;margin-top:0px;margin-bottom:16px;c=
olor:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe=
 UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Se=
goe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:14px">// Get BIDI =
types<br style=3D"box-sizing:border-box">fribidi_get_bidi_types(unicodeStri=
ng, (uint32_t)text.size(), bidiTypes);</p><p style=3D"box-sizing:border-box=
;margin-top:0px;margin-bottom:16px;color:rgb(36,41,46);font-family:-apple-s=
ystem,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&q=
uot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbo=
l&quot;;font-size:14px">// Get BIDI levels<br style=3D"box-sizing:border-bo=
x">FriBidiLevel resolveParDir =3D fribidi_get_par_embedding_levels(bidiType=
s, (uint32_t)text.size(), <b>FRIBIDI_PAR_RTL</b>, bidiLevels);</p><p style=
=3D"box-sizing:border-box;margin-top:0px;margin-bottom:16px;color:rgb(36,41=
,46);font-family:-apple-system,BlinkMacSystemFont,&quot;Segoe UI&quot;,Helv=
etica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&q=
uot;,&quot;Segoe UI Symbol&quot;;font-size:14px">And in the result, I get t=
he BIDI levels below:<br style=3D"box-sizing:border-box">2 2 2 2 1 1 0 0 0 =
0 1 0 0 0 0 0</p><p style=3D"box-sizing:border-box;margin-top:0px;margin-bo=
ttom:16px;color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,=
&quot;Segoe UI&quot;,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quo=
t;,&quot;Segoe UI Emoji&quot;,&quot;Segoe UI Symbol&quot;;font-size:14px">T=
he question is: why I have a level change for the first &#39;.&#39; but not=
 for the following &#39;.&#39;?</p></div></div>

--f403045d6f481b7990055974fe4f--

--===============0657220203==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZnJpYmlkaSBt
YWlsaW5nIGxpc3QKZnJpYmlkaUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m
cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9mcmliaWRpCg==

--===============0657220203==--