自定义阿拉伯字体可在iOS 7中使用,但不能在iOS 6或更早版本中使用 [英] Custom arabic font working in iOS 7 but not in iOS 6 or earlier

查看:136
本文介绍了自定义阿拉伯字体可在iOS 7中使用,但不能在iOS 6或更早版本中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用自定义阿拉伯字体的iPhone应用程序.

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

所有人都可以在iOS 7中正常工作.

All is working in iOS 7.

当我在iOS 6上运行该应用程序时,文本以默认的iPhone字体显示.

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

有什么想法吗?

如果您发现两者之间的差异,则英语说得很好.

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

推荐答案

问题已解决...

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;

这篇关于自定义阿拉伯字体可在iOS 7中使用,但不能在iOS 6或更早版本中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆