When styling (e.g. with colors) Arabic letters, they may not join in some rendering tools. For exemple, in Firefox letters joins but not in Safari or Chrome.

Arabic presentation forms (FE70-FEFC or FB50-FDFF), even if deprecated by Unicode, may helps solve this problem.

1- Normal text

المغرب

2- With normal letters colored

المغرب (should be Joined colored letters instead of Non joining colored letters)

3- Same as above with a font which forms the ligature Lam + Meem

المغرب ( should be Joined colored letters with ligature instead of Non joining colored letters with ligature) Note the two colors on Lam + Meem

4- With contextual letters

Lam intial form (U+FEDF), Meem medial form (U+FEE4), Ghain medial form (U+FED0), Reh final form (U+FEAE)

اب (should be Contextual colred letters)

5- With contextual letters *and* one-char-ligature for Lam with Meem,  initial form (U+FCCC)

اب (should be Contectual colored letters with ligaure) Note the same colors on Lam + Meem

6 Force letters to join with zero-width joiner (ZWJ, U+200D)

ا ل‍ م‍ غ‍ ر‍ ب (should be Joined colored letters instead of Non joining colored letters or Non joining colored letters)


abcd

a b c d