fribidi_get...ng_levels_ex(3)
π NAME
fribidi_get_par_embedding_levels_ex β bestie, this is the one that gets you the bidi embedding levels of a whole paragraph β¨
(also hi, you're reading the Programmer's Manual, welcome to the function that does the actual Unicode bidi heavy lifting π«Ά)
π SYNOPSIS
#include <../fribidi/lib/fribidi.h>
FriBidiLevel fribidi_get_par_embedding_levels_ex
(
const FriBidiCharType *bidi_types,
const FriBidiBracketType *bracket_types,
const FriBidiStrIndex len,
FriBidiParType *pbase_dir,
FriBidiLevel *embedding_levels
);
πΈ PARAMETERS
const FriBidiCharType *bidi_typesβ the input list of bidi types, exactly as handed back byfribidi_get_bidi_types(). π
and okay so, a little note: since there are 23 possible values for a const FriBidiCharType, they are not all listed here. iykyk, there's literally 23 of them, we're not doing that π
const FriBidiBracketType *bracket_typesβ the input list of bracket types, as handed back byfribidi_get_bracket_types(). πconst FriBidiStrIndex lenβ input string length of the paragraph. that's it, that's the whole vibe. πFriBidiParType *pbase_dirβ the requested and resolved paragraph base direction. it goes in as your ask and comes back as the answer, main character energy fr fr β¨
the possible values for a FriBidiParType are, in order:
FRIBIDI_PAR_LTRβ Left-To-Right paragraph.FRIBIDI_PAR_RTLβ Right-To-Left paragraph.FRIBIDI_PAR_ONβ DirectiOn-Neutral paragraph. (yes it's spelled like that, iconic π )FRIBIDI_PAR_WLTRβ Weak Left To Right paragraph.FRIBIDI_PAR_WRTLβ Weak Right To Left paragraph.
FriBidiLevel *embedding_levelsβ the output list of embedding levels. this is where the magic lands, your fave delivery slot π¦
π₯ DESCRIPTION
okay so here's what's tea β: this function finds the bidi embedding levels of a single paragraph, as defined by the Unicode Bidirectional Algorithm, which lives at http://www.unicode.org/reports/tr9/. go read it, it's giving lore.
she implements rules P2 to I1 inclusive, and parts 1 to 3 of L1 β with one exception, rule X9, because X9 is implemented over in fribidi_remove_bidi_marks() instead. and part 4 of L1? that one lives in fribidi_reorder_line(). so like, this function does her part and trusts her friends to do theirs, teamwork slay π€
also! there are a few macros defined in fribidi-bidi-types.h to work with these embedding levels. so go look at those before you start hand-rolling stuff, bestie, i'm begging π
β RETURNS
maximum level found plus one π β or zero if any error occurred (memory allocation failure, most probably π).
ngl if you get a 0 back, don't just keep going β check that allocation. zero is the "something went wrong" vibe check and it failed. π
π¦ SEE ALSO
the whole friend group, fr fr:
fribidi_shape_arabic(3),fribidi_get_par_direction(3),fribidi_reorder_line(3)fribidi_get_bidi_type(3),fribidi_get_bidi_types(3),fribidi_get_bidi_type_name(3)fribidi_charset_to_unicode(3),fribidi_unicode_to_charset(3),fribidi_parse_charset(3)fribidi_debug_status(3),fribidi_set_debug(3)fribidi_mirroring_status(3),fribidi_set_mirroring(3)fribidi_reorder_nsm_status(3),fribidi_set_reorder_nsm(3)fribidi_log2vis_get_embedding_levels(3)fribidi_get_type(3),fribidi_get_type_internal(3),fribidi_get_par_embedding_levels(3)fribidi_join_arabic(3),fribidi_get_joining_type(3),fribidi_get_joining_types(3),fribidi_get_joining_type_name(3)fribidi_get_mirror_char(3),fribidi_shape_mirroring(3)fribidi_get_bracket(3),fribidi_get_bracket_types(3),fribidi_shape(3)fribidi_remove_bidi_marks(3),fribidi_log2vis(3)
and that's the page, bestie π«Ά this lil gift was generated by c2man from fribidi-bidi.h, dated 29 October 2026 β go forth and get those embedding levels, you're gonna ate ππ
π¦ where this page comes from
- arch rolling: fribidi 1.0.18-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms