[FriBidi] Fribidi not returning the correct number of characters
Khaled Hosny
dr.khaled.hosny at gmail.com
Fri Dec 27 11:13:50 UTC 2019
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 <hellozee at disroot.org> 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
> fribidi at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/fribidi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/fribidi/attachments/20191227/006194b6/attachment.htm>
More information about the fribidi
mailing list