Peace be upon you,
as requested from many guys I am writing this topic, some people was asking how the Arabization works?
here is a brief answer for this question, I will sort it be stages,
First: you have to ensure that the system has a free font type support
why is it so important?
simply, the free type gives you a very good ability which is the system will draw the character for you, you don't have to think how the fonts will look like, how will u draw it all of this question will be disappear with simple idea, it is simple but powerful
What if the system doesn't support Free Type?
you will have to do it your self, you will have to draw the character by your self, for example, you can put the character in BMP or JPG, and do some graphics engine that put characters together and make it look like one sentence
Second: Bi Di, this stage is very important and take a lot of time to be done, if you are going to do it by your self,
fortunately that there is library and it is open source, it is called "FriBiDi"
here is links for this GREAT project
http://sourceforge.net/projects/fribidi
http://fribidi.freedesktop.org/wiki/
this library will help you to rearrange the Arabic Characters, because Arabic from right to left, the whole words will be reversed, so you will have to fix it, also there is many consideration that this library solve, like what if there is English word in the middle of the statement, then it will be MESS, this library will solve the problem
there is one more thing, when I was implementing the algorithm I face a very nice problem, the whole word length, when you fix the string you make like, the first character will be the last and vise versa, when you put this statement in Text Box or any object to display, you will have this problem which is , the lines will be reversed :D
the problem can be solved by detecting the character width, and display area width, so you only put what is enough to display per line, this will help to avoid this problem
Last : Shaping, shaping is very nice and it is totally take no time to do it, simple you will detect the character location ( Start, Middle, End or Standalone ) because Arabic character has 4 shapes, you have to do this part, after that you will find the Arabic string looks OK, and ready to print
How did I do that with Android?
simply when I was watching the Introduction video, I notice that the guy said "Free Type Support"
I smiled then I open the Emulator, and I started looking for the font folder,
as I don't know how to register new font in Android, I replaced the Original font
the cool part comes when I noticed that they have already done the Bi Di support
at the moment I released that all it needs is just Reshape the character the statement
I did this part and guess what it WORKS
there is other many consideration about the Arabization, if you face some please don't hesitate to ask
I hope that this topic was informative for you :)
Thanks for your time
Ahmed Essam
Tuesday, December 04, 2007
Subscribe to:
Post Comments (Atom)

4 comments:
Asalamo Alaykom ...
Thank you ahmed ...
I went through similar Issues because Arabic is supported yes, but not always and sometimes with Limitations.
some software vendors prefer not to support arabic at all.
anyway most of the sources i found on the Internet talk about other right-To-Left languages such as Hebrew, Asian Languages.
Minor ones talk about Arabic.
This article is most usefull for those who deal with Embedded devices, mobile Development and Linux, UNIX Development.
thanks again!
Peace be upon you
this one of the reasons that push me to write this Article, actually I will do more for it, I have some code that I have wrote for such thing, but this stuff need some time for investigation,
anyways, I am ready to be a RESOURCE for any one who need any support for the Arabic Issue
Nice, but I will guess they will shape the text before final release.
Salamo 3lykom
Are you talking about Android?
as I think, they like to open the market for 3rd party companies, u know that windows mobile doesn't has Arabic support, Imaginet is the biggest company for the Arabic support for pocket pc(BTW I was working there but on something else not in the Arabic Support), also the issue is not about the Arabic support it self, you know that loading fonts comsume some memory, they will not add the Arabic for few reasons, first if they are going to support arabic then they should support all languages, do u know how much the size of the font file that has all languages it's about 18 Mega Bytes, it is too much for small machines like mobile, I tried once to put it the device get hang, I think they will do like Microsoft, many copies for the Windows mobile localized depending on the region, there is no envy about the Arabic if someone gonna think like that, Microsoft invest on what is getting real benefit right now there is no benefit from adding arabic support by default, if you think about the capability, Microsoft can easily add the arabic support.
by the way , I have comment about the Arabic support on Windows, while I am doing some experiments on it I found that the Arbaic support that is provided by Imaginet is more efficient than the defualt Arabic Support that on normal Windows, until now I Don't get deeper to know why, but I think that guys in Imaginet have done a lot of work to enhance it over the time, it they did it good,
I hope to hear back from you Mohamed
thanks for your time :)
Post a Comment