<div dir="auto">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.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 26, 2019, 3:00 PM Kuntal Majumder <<a href="mailto:hellozee@disroot.org">hellozee@disroot.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi<br>
<br>
I am not sure if this is the right place to ask or not  but nevertheless, I <br>
will, :P<br>
<br>
I was researching a bit on drawing text for Krita[1], as the text tool is in 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 interface <br>
to work with text layouting.<br>
<br>
It worked fine to the point I was using English input but crashed as soon as <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 the <br>
string. <br>
<br>
I wrote a small test to confirm that, which can be found here[2]. I am having <br>
a feeling that what I am doing is wrong but I don't know.<br>
<br>
Sorry to bother you folks over holidays, thanks, :3<br>
<br>
[1] <a href="https://github.com/HOST-Oman/libraqm/blob/master/src/raqm.c#L467" rel="noreferrer noreferrer" target="_blank">https://github.com/HOST-Oman/libraqm/blob/master/src/raqm.c#L467</a><br>
[2] <a href="https://gist.github.com/hellozee/45cd60347ba38bcb008b675997e0745e" rel="noreferrer noreferrer" target="_blank">https://gist.github.com/hellozee/45cd60347ba38bcb008b675997e0745e</a><br>
-- <br>
Regards<br>
Kuntal M<br>
<a href="https://hellozee.dev" rel="noreferrer noreferrer" target="_blank">https://hellozee.dev</a><br>
<br>
<br>
_______________________________________________<br>
fribidi mailing list<br>
<a href="mailto:fribidi@lists.freedesktop.org" target="_blank" rel="noreferrer">fribidi@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/fribidi" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/fribidi</a><br>
</blockquote></div>