Re: Arabic ligature shaping code

Behdad Esfahbod <[email protected]>
Newsgroups gmane.comp.internationalization.fribidi
Message-ID <[email protected]>
Hi Omer and list,

Long time no post here.  Lemme write in short what I've been
doing so far.  I need a couple of helping hands.

Well, around the time that we moved the list to freedesktop.org,
we also moved the CVS repository and home page too.  So here is
the new page with information about CVS access and all:

http://freedesktop.org/Software/FriBidi

Since then I have been heavily working on the code base from
STABLE branch.  I reordered all files and brought everything up
to date and in fact reimported in the new CVS.  The new headers
may look a bit ugly, but they are supposed to just make it more
portable, not less.

Apart from build system and a very poor documentation (using
c2man), I've updated the character database to that of Unicode
4.0.1, fixed few bugs, and broke the API to export full control
over what Unicode conformance demands.  This means that we go
with a completely new API.  The old API is supposed to remain in
a pair of files fribidi-compat.[ch] for a while.

Moreover, after discussions with Mark Davis in the recent Unicode
Technical Committee meeting in Toronto, I finally implemented an
authentic Arabic joining algorithm.

What has remained is Arabic Shaping which is the easy part, but
I'm getting lazy again...  Then to do the FriBidiEnv patch again,
and then update fribidi for the command-line.  Since then, I
appreciate if people check out the code, build and try to run
their applications using the new stuff.  The main function
fribidi_log2vis is still there so there should be no big problem.
I'm interested in early feedback.

More comments below:

On Sun, 4 Jul 2004, Omer Zak wrote:

> Hello Behdad,
> I was busy on higher-priority issues, but now I am back to Arabic related
> work.
> You mentioned at the time that you have problem with scripts for building
> tables of glyph properties.
> What is the current status in this area?

I'm almost fine now.  Shaping needs some 4 more tables which is
why is lingering this much :(.

> At the time I wrote a script for converting Unidata/ArabicShaping.txt into
> C++ tables.

Well, that's my masochism :-).  I like both fast and compact
tables.

> But I found no official source for ligature substitutions (like
> substitution of LAM+ALEF ligatures into Presentation Forms-B block), and
> my source was an old script by Cyzborrah (which I know to have at
> least one error).
> Do you have any suggestion for official database from which I can build
> table for ligature substitutions?

Good question, I'm the master in this stuff now :D.  I decided
for the new FriBidi code, I'm not going to hard-code ANY Unicode
code-point, so I've got to get everything out of the tables.  The
fact is that you are not supposed to use Pres Forms-B to form
your ligatures.  The standard says that Lam-like + Alef-like
should be ligated.  So you get a list of Lam-like letters and
Alef-like letters.  This can be extracted from ArabicShaping.txt.
Then you look for in UnicodeData.txt for ligatures of
Lam-like + Alef-like, in field 5 (starting from 0).  You find
both <isolated> and <final> forms for the ligature, so you choose
the one you need.  Means, you do ligatures *with* shaping, not
*after* shaping.  (in fact you do *before* shaping but after
joining, that's why I differentiate shaping and joining).

> Another question:
> Where can I get the most recent CVS snapshot of FriBidi
> (cvs.fribidi.sourceforge.net times out on me)?

http://freedesktop.org/Software/FriBidi#CVS

Cheers,
--behdad
  behdad.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.