|
From: | Turner, David |
Subject: | RE: [ft] does freetype support Arabic? |
Date: | Tue, 7 Jun 2005 16:35:30 +0200 |
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 : address@hidden [mailto:address@hiddenDe la part de address@hidden Envoyé : mardi 7 juin 2005 13:29 À : address@hidden Objet : [ft] does freetype support Arabic?
|
[Prev in Thread] | Current Thread | [Next in Thread] |