在iPhone上使用自定义阿拉伯字体的问题 [英] Problem using custom Arabic font on iPhone

查看:209
本文介绍了在iPhone上使用自定义阿拉伯字体的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用MonoTouch开发一个iPhone应用程序,它使用了一个自定义的阿拉伯字体(Scheherazade from http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ArabicFonts )。我没有问题在我的应用程序中加载字体。我也看到,当我使用拉丁语文本,但是当我想要显示阿拉伯文本,它使用默认的系统字体显示文本。



有没有人使用自定义阿拉伯字体和MonoTouch / iPhone开发的经验或者有一个想法,为什么发生这种情况?

预先感谢您。

最好的问候,

这些课程将完成这项工作:



https://github.com/Accorpa/Arabic-Converter-From-and-To-Arabic-Presentation-Forms-B
<



一个代码示例:

$ p>下载它们,我很肯定地回答你的问题,因为我之前有完全相同的问题。 b
$ b

  ArabicConverter * converter = [[ArabicConverter alloc] init]; 
NSString * convertedString = [converter convertArabic:@منذدقيقة];
infoText.font = [UIFont fontWithName:@YOUARABICFONTsize:16];
infoText.text = convertedString;


I'm developing an iPhone application with MonoTouch that uses a custom Arabic font (Scheherazade from http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=ArabicFonts). I don't have problems getting the font loaded in my application. I also see that it is used when I use Latin text but when I want to display Arabic text it uses a default system font for displaying the text.

Does anyone have any experience with custom Arabic fonts and MonoTouch/iPhone development or has an idea why this is happening?

Thank you in advance.

With kindest regards,

Taner Gedikoglu

解决方案

These classes will do the job :

https://github.com/Accorpa/Arabic-Converter-From-and-To-Arabic-Presentation-Forms-B

Download them, and I'm pretty sure that answers your question because I had the exact same problem before!

An example of the code :

ArabicConverter *converter = [[ArabicConverter alloc] init];
NSString* convertedString = [converter convertArabic:@"منذ دقيقة"];
infoText.font = [UIFont fontWithName:@"YOUARABICFONT" size:16];
infoText.text = convertedString;

这篇关于在iPhone上使用自定义阿拉伯字体的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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