[FriBidi] multiple line

Shachar Shemesh shachar at shemesh.biz
Mon Sep 18 20:38:40 UTC 2017


Please see if
https://www.lingnu.com/programming/57-bidi-aware-programming-introduction.html
is of any help in understanding how to apply the bidi algorithm over
multiple lines. It is not FreeBidi specific, but was meant to help in
understanding of the concepts.

Shachar

On 18/09/17 14:24, Yuri D. wrote:
> 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 '.'?
>
>
>
> _______________________________________________
> 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/20170918/d4a0e2bb/attachment.html>


More information about the fribidi mailing list