Atif Sultanuddin
Atif Sultanuddin

Reputation: 69

How do I display a custom Arabic font in my iPhone app?

How do I display a custom Arabic font (Quran in Uthmani) in my iPhone app?

Upvotes: 2

Views: 2443

Answers (3)

bbaassssiiee
bbaassssiiee

Reputation: 6812

This works fine for Roman text but not for Arabic text. If I load English text with two distinct fonts they are different, if I load Arabic text using those same fonts they show the same, except for some spacing.

Smells like a bug.

Upvotes: 0

Saurabh
Saurabh

Reputation: 22893

You just need to drag the font’s ttf file in your resource folder and do this following entry in your info.plist file –

<key>UIAppFonts</key>
<array>
        <string>CloisterBlack.ttf</string>
</array>

UIAppFonts key accept a array so you can pass multiple fonts in it.

Now wherever you want to use the font in your application you can call:

[UIFont fontWithName:@"Cloister Black" size:64.0]

Just make sure you give the real font name in above code. The font file name and its “real font name” can be different, so just open the font in FontBook app and there you can see the real name of the font.

you can read my blog entry on using custom fonts in iphone app here - http://www.makebetterthings.com/blogs/iphone/how-to-use-custom-fonts-in-iphone/

Upvotes: 1

RyanR
RyanR

Reputation: 7758

Core Text allows you to embed fonts and render custom glyphs.

Upvotes: 2

Related Questions