Re: Fribidi not returning the correct number of characters

Khaled Hosny <[email protected]> Fri, 27 Dec 2019 13:13:50 +0200
Newsgroups gmane.comp.internationalization.fribidi
Message-ID <CAKgnQDTKvOYReGkxnecgGBthpdCDssmFwp-5oYUoBR+fMYJMRw@mail.gmail.com>
--===============0265664661==
Content-Type: multipart/alternative; boundary="00000000000055ae9a059aad976c"

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

The length argument should be the length of the input string i.e. the
number of UTF-8 bytes, not the number of Unicode code points.

On Thu, Dec 26, 2019, 3:00 PM Kuntal Majumder <[email protected]> wrote:

> Hi
>
> I am not sure if this is the right place to ask or not  but nevertheless,
> I
> will, :P
>
> I was researching a bit on drawing text for Krita[1], as the text tool is
> in a
> pretty bad condition and requires revamp. I stumbled upon libraqm which is
> thin wrapper over fribidi, harfbuzz and freetype with a comfortable
> interface
> to work with text layouting.
>
> It worked fine to the point I was using English input but crashed as soon
> as
> switch to Bengali. Upon investigating a little bit, I found the call to
> `fribidi_charset_to_unicode` made here[1] is returning a wrong length of
> the
> string.
>
> I wrote a small test to confirm that, which can be found here[2]. I am
> having
> a feeling that what I am doing is wrong but I don't know.
>
> Sorry to bother you folks over holidays, thanks, :3
>
> [1] https://github.com/HOST-Oman/libraqm/blob/master/src/raqm.c#L467
> [2] https://gist.github.com/hellozee/45cd60347ba38bcb008b675997e0745e
> --
> Regards
> Kuntal M
> https://hellozee.dev
>
>
> _______________________________________________
> fribidi mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/fribidi
>

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

<div dir=3D"auto">The length argument should be the length of the input str=
ing i.e. the number of UTF-8 bytes, not the number of Unicode code points.<=
/div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">O=
n Thu, Dec 26, 2019, 3:00 PM Kuntal Majumder &lt;<a href=3D"mailto:hellozee=
@disroot.org">[email protected]</a>&gt; wrote:<br></div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad=
ding-left:1ex">Hi<br>
<br>
I am not sure if this is the right place to ask or not=C2=A0 but neverthele=
ss, I <br>
will, :P<br>
<br>
I was researching a bit on drawing text for Krita[1], as the text tool is i=
n a <br>
pretty bad condition and requires revamp. I stumbled upon libraqm which is =
<br>
thin wrapper over fribidi, harfbuzz and freetype with a comfortable interfa=
ce <br>
to work with text layouting.<br>
<br>
It worked fine to the point I was using English input but crashed as soon a=
s <br>
switch to Bengali. Upon investigating a little bit, I found the call to <br=
>
`fribidi_charset_to_unicode` made here[1] is returning a wrong length of th=
e <br>
string. <br>
<br>
I wrote a small test to confirm that, which can be found here[2]. I am havi=
ng <br>
a feeling that what I am doing is wrong but I don&#39;t know.<br>
<br>
Sorry to bother you folks over holidays, thanks, :3<br>
<br>
[1] <a href=3D"https://github.com/HOST-Oman/libraqm/blob/master/src/raqm.c#=
L467" rel=3D"noreferrer noreferrer" target=3D"_blank">https://github.com/HO=
ST-Oman/libraqm/blob/master/src/raqm.c#L467</a><br>
[2] <a href=3D"https://gist.github.com/hellozee/45cd60347ba38bcb008b675997e=
0745e" rel=3D"noreferrer noreferrer" target=3D"_blank">https://gist.github.=
com/hellozee/45cd60347ba38bcb008b675997e0745e</a><br>
-- <br>
Regards<br>
Kuntal M<br>
<a href=3D"https://hellozee.dev" rel=3D"noreferrer noreferrer" target=3D"_b=
lank">https://hellozee.dev</a><br>
<br>
<br>
_______________________________________________<br>
fribidi mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank" rel=3D"n=
oreferrer">[email protected]</a><br>
<a href=3D"https://lists.freedesktop.org/mailman/listinfo/fribidi" rel=3D"n=
oreferrer noreferrer" target=3D"_blank">https://lists.freedesktop.org/mailm=
an/listinfo/fribidi</a><br>
</blockquote></div>

--00000000000055ae9a059aad976c--

--===============0265664661==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
fribidi mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fribidi

--===============0265664661==--