Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone : Unable to display Arabic fonts properly. How to use glyphs to display it?

I want to display arabic fonts(me_quran fonts) in my app. I have arabic text in my database.

Example of arabic text : "بِسْمِ ٱللَّهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ"

I have tried following things.

1) Try :

In info.plist file I have added .ttf file in the fonts provided by application option.

[UIFont fontWithName:@"me_quran" size:20.0];

2) Try :

Tried with the ArabicConverter demo code.

Results in the above try :

App is not displaying the proper arabic fonts. For example, it use to display circle where suppose to be half circle like moon shape. and many times it use to display only lines rather then line with some curves.

I got some links which are : link1 , link2. But this links does not contain much information on how to solve the problem.

The interesting thing which I got is to use glyphs to solve the problem. But I do not know how to use it?

Can anybody give me some idea or link on how to use glyphs in iOS? or any sample project ?

like image 544
Devang Avatar asked Jun 16 '12 06:06

Devang


2 Answers

Arabic/Persian fonts are not well-defined in Xcode, and the only default font for them, is the "Geeza" font. I haven't used glyphs, but here's an API for Persian fonts, and that must work for Arabic fonts, too. Check it out, and see if that helps.

like image 120
Neeku Avatar answered Oct 12 '22 16:10

Neeku


Salam,

I have tried your example using ArabicConverter, and it worked with me, may be you are using a different font than me_quran

before using ArabicConverter:

after using ArabicConverter:

like image 36
AhmedHofny Avatar answered Oct 12 '22 16:10

AhmedHofny