fribidi_get_par_embedding_levels_ex (3) - Linux Manuals

fribidi_get_par_embedding_levels_ex: get bidi embedding levels of a paragraph


fribidi_get_par_embedding_levels_ex - get bidi embedding levels of a paragraph


#include <fribidi.h>

extern FriBidiLevel fribidi_get_par_embedding_levels_ex
       const FriBidiCharType *bidi_types,

       const FriBidiBracketType *bracket_types,

       const FriBidiStrIndex len,

       FriBidiParType *pbase_dir,

       FriBidiLevel *embedding_levels



const FriBidiCharType *bidi_types
Input list of bidi types as returned by fribidi_get_bidi_types().

Since there are 23 possible values for a const FriBidiCharType, they are not all listed here.

const FriBidiBracketType *bracket_types
Input list of bracket types as returned by fribidi_get_bracket_types().
const FriBidiStrIndex len
Input string length of the paragraph.
FriBidiParType *pbase_dir
Requested and resolved paragraph base direction.

Possible values for a FriBidiParType are as follows:

Left-To-Right paragraph.
Right-To-Left paragraph.
DirectiOn-Neutral paragraph.
Weak Left To Right paragraph.
Weak Right To Left paragraph.
FriBidiLevel *embedding_levels
Output list of embedding levels.


This function finds the bidi embedding levels of a single paragraph, as defined by the Unicode Bidirectional Algorithm available at This function implements rules P2 to I1 inclusive, and parts 1 to 3 of L1, except for rule X9 which is implemented in fribidi_remove_bidi_marks(). Part 4 of L1 is implemented in fribidi_reorder_line().

There are a few macros defined in fribidi-bidi-types.h to work with this embedding levels.


Maximum level found plus one, or zero if any error occurred (memory allocation failure most probably).