问题
How do I display a custom Arabic font (Quran in Uthmani) in my iPhone app?
回答1:
Core Text allows you to embed fonts and render custom glyphs.
回答2:
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/
回答3:
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.
来源:https://stackoverflow.com/questions/6481599/how-do-i-display-a-custom-arabic-font-in-my-iphone-app