fribidi_shape_arabic(3)

πŸ’… fribidi_shape_arabic(3) β€” the Arabic shaping one

okay bestie, welcome to the Programmer's Manual ✨ this is the page for fribidi_shape_arabic, and yeah it's giving slightly-scary-C-function but honestly it's so good once u get it. buckle up πŸŽ€


🌸 NAME 🌸

fribidi_shape_arabic β€” do Arabic shaping. that's it, that's the whole vibe. it shapes. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <../fribidi/lib/fribidi.h>

void fribidi_shape_arabic
(
     FriBidiFlags flags,
     const FriBidiLevel *embedding_levels,
     const FriBidiStrIndex len,
     FriBidiArabicProp *ar_props,
     FriBidiChar *str
);

no cap, that's the whole signature, copy it exactly bestie 🫢


🌈 PARAMETERS 🌈

  • FriBidiFlags flags β€” the shaping flags!! these decide what actually happens in there, so pay attention, main character energy only πŸ”₯
  • const FriBidiLevel *embedding_levels β€” Not Documented. yeah. iconic of them honestly 😭 that's literally all the page says about it, so i'm not gonna invent lore.
  • const FriBidiStrIndex len β€” input string length. just how long ur string is, bestie πŸ“
  • FriBidiArabicProp *ar_props β€” input/output Arabic properties, as computed by fribidi_join_arabic. note the input/output β€” she reads AND writes, so she's not just a passenger πŸ’œ
  • FriBidiChar *str β€” the string to shape. this is the glow-up target πŸ‘‘

✨ DESCRIPTION ✨

okay so the actual shaping that gets done depends on the flags u set. only flags starting with FRIBIDI_FLAG_SHAPE_ARAB_ affect this function. currently these are:

  • FRIBIDI_FLAG_SHAPE_MIRRORING β€” do mirroring.
  • FRIBIDI_FLAG_SHAPE_ARAB_PRES β€” shape Arabic characters to their presentation form glyphs.
  • FRIBIDI_FLAG_SHAPE_ARAB_LIGA β€” form mandatory Arabic ligatures.
  • FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE β€” perform additional Arabic shaping suitable for text rendered on grid terminals with no mark rendering capabilities.

of the above, FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE is only used in special cases β€” like, she's the niche one, she comes out for specific situations only πŸ™ˆ but the rest are recommended in any environment that doesn't have other means for doing Arabic shaping. so like, if nothing else in ur stack is handling this, these flags are ur besties fr fr.

and the set of extra flags that enable this level of Arabic support has a shortcut named FRIBIDI_FLAGS_ARABIC πŸ’– use the shortcut, live ur life.

ngl the whole function hinges on those flags β€” set them wrong and she'll shape different stuff. no guessing, just read ur flags πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

the whole extended universe, bestie β€” every single one, no skipping:

fribidi_get_par_direction(3), fribidi_get_par_embedding_levels_ex(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)

like, that's the whole friend group. go read them, iykyk πŸ“š


πŸŽ€ sign-off πŸŽ€

this lil beauty came from c2man fribidi-arabic.h and it's dated 29 October 2026 ⭐ so yeah, that's the source, that's the version, that's the date β€” writing it down so u have receipts πŸ’–

okay go shape some Arabic text bestie, u got this, periodt πŸ¦‹πŸ’…

πŸ“¦ where this page comes from