Custom Arabic font in iOS

Short answer

This seems to be a bug in iOS.

Long answer

As you may know, the arabic text needs to be shaped before it can be rendered, that means converting the basic letters (Unicode:0600-06FF) to their proper corresponding contextual letters (Unicode:FE70-FEFF).

iOS does this preprocessing automatically for arabic text, but for some reason, it forgets about the custom font and just uses system default font when it renders the connected letters.

So, it’s a bug in iOS and you should wait for it to be solved.

Workaround

Though, if you can’t wait, you can use this workaround:
Do the preprocessing of the text manually before rendering it. This will allow skipping iOS preprocessing phase which causes this issue and thus rendering the text using your custom font.

If you want to test this solution, just copy this following line and try it in your project:

arabicLabel.text = @"ﺍﻟﺴﻼﻡ ﻋﻠﻴﻜﻢ";

Leave a Comment