This is not trivial, and must be performed on top of FreeType.
I'll ignore the problem of bidirectionnal text for the moment, since this adds
another layer of complexity.
 
There is an "easy" way which consists in using the Arabic presentation forms
of Unicode (in the ranges U+FB50..U+FBFD and U+FE70..U+FEFC), but this
only works well when your input text encoding is limited, e.g. ISO-Arabic
(a.k.a. ISO 8859-6) and when the font you're using has placed glyphs in
correct positions of the Unicode charmap (most Arabic fonts I've seen do).
Note that you'll be limited in your output though.
 
In this case, you can write a rather simple parser that is capable of converting
character codes depending on their positional attributes. Of course, your parser
must determine for each character wether it is in initial, middle, final or isolated
form, then get the proper Unicode code for it. Bonus points for handling some
basic ligatures available in the presentation forms.
 
The "hard" way consists in parsing the OpenType or AAT tables available in
the font (when they're here), which requires much more logic on top of the
font engine.
 
In all cases, this is no trivial, and you should better use something like Pango
or UCI to do the work for you. They also handle BIDI by the way.
 
Regards,
 
- David Turner
- The FreeType Project  (www.freetype.org)
 
 
  -----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]De la part de [EMAIL PROTECTED]
Envoyé : mardi 7 juin 2005 13:29
À : [email protected]
Objet : [ft] does freetype support Arabic?

hello,guys!
 I tried to use freetype to display English, Thai, Chinese,etc.. It dose work wonderful.but when I try to display Arabic, there is a problem: the characters don't change with the different adjacent characters. How to solve this problem?
 
 
thanks,
Raynor
_______________________________________________
Freetype mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/freetype

Reply via email to