Custom arabic font working in iOS 7 but not in iOS 6 or earlier

☆樱花仙子☆ 提交于 2019-12-07 19:16:46

问题


I have an iPhone app where I am using custom arabic font.

All is working in iOS 7.

When I run the app on iOS 6, the text is appearing in default iPhone font.

Any idea what is going wrong?

iOS 6 Screenshot

iOS 7 Screenshot

If you see the difference, english is working fine. ONLY PROBLEM WITH ARABIC FONT.


回答1:


Problem solved...

UILabel *arTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 200, 300, 100)];
arTitle.backgroundColor = [UIColor clearColor];
arTitle.textColor = [UIColor blueColor];
arTitle.textAlignment = NSTextAlignmentCenter;
arTitle.font = [UIFont fontWithName:@"GEDinarOne-Medium" size:16.0];
arTitle.numberOfLines = 0;
arTitle.text = @"واللقب هو عربي مع خط مخصص";

// these two line made effect...    
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:arTitle.text attributes:@{ NSFontAttributeName : [UIFont fontWithName:@"GEDinarOne-Medium" size:16], NSLigatureAttributeName: @2}];

arTitle.attributedText = attributedString;


来源:https://stackoverflow.com/questions/20089680/custom-arabic-font-working-in-ios-7-but-not-in-ios-6-or-earlier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!