Custom Arabic font in iOS

I am trying to make an iphone application that displays mainly Arabic language content. I want to use a custom Arabic font for displaying that content, not the iPhone default Arabic font. I used the following code:

- (void)viewDidLoad {
    [super viewDidLoad];
    [arabicLabel setFont: [UIFont fontWithName: @"Simple Indust Shaded" size: 20]];
    arabicLabel.text = @"السلام عليكم";
}

where arabicLabel is an IBOutlet UILabel. I put the label in the App resources and add it to the info.plist file as UIAppFont array item. Also the font is Unicode.

When I run this code on the simulator, the label displayed the default Arabic font (not my custom font); however it set its size to 20 as stated in the code!

I don't understand what I did wrong here... I know that in the info.plist file I must add the font file name with extension (ttf), and I did that. Also, I know that in the previous code I had to put the actual font name not file name, so I opened the file in my Mac and used the title that appeared when the file is opened (Simple Indust Shaded).

Am I missing something? Are there any extra requirements for custom fonts other than being Unicode?

NB: I did the same procedure for custom English font, and it worked!...

7
задан Peter Mortensen 7 September 2013 в 22:18
поделиться