emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arabic support


From: Kenichi Handa
Subject: Re: Arabic support
Date: Mon, 06 Sep 2010 15:04:46 +0900

In article <address@hidden>, Eli Zaretskii <address@hidden> writes:

> I think I found what I was missing.  This part:
[...]
> is inaccurate, and therefore leads to incorrect conclusions.  A
> (hopefully) more correct description is this:

>   During the buffer scan that delivers characters to PRODUCE_GLYPHS,
>   if the next character to be delivered is a composed character, then
>   composition_reseat_it and next_element_from_composition are called.
>   If they succeed to compose the character with one or more following
>   characters, the whole sequence of characters that where composed is
>   recorded in the `struct composition_it' object that is part of the
>   buffer iterator.  The composed sequence could produce one or more
>   font glyphs (called "grapheme clusters") on the screen.  Each of
>   these grapheme clusters is then delivered to PRODUCE_GLYPHS in the
>   direction corresponding to the current bidi scan direction.  In
>   particular, if the bidi iterator currently scans the buffer
>   backwards, the grapheme clusters are delivered back to front.  This
>   reorders the grapheme clusters as appropriate for the current bidi
>   context.

> If this is correct,

Yes.

> then the conclusion is that the font driver's
> `shape' method should return the grapheme clusters in LGSTRING in
> logical order; they will be reordered correctly by
> next_element_from_composition, composition_reseat_it, and
> set_iterator_to_next, as described above.

> Did I get it right this time?

Yes.

One additional comment.  A grapheme cluster in LGSTRING may
contain multiple glyphs, and the order of those glyphs
depends on a font backend, or even on a font, and are given
to `draw' method of a font backend without reordering.  It's
the responsibility of 'shape' method to produce those glyphs
in the order that 'draw' method expects.

For instance, if LGSTRING has these LGLYPHS in this order:

G0: (glyph for a char at position N)
G1: (first glyph for chars at position N+1 to N+2)
G2: (second glyph for chars at position N+1 to N+2)
G3: (first glyph for chars at position N+3 to N+4)
G4: (second glyph for chars at position N+3 to N+4)
G5: (third glyph for chars at position N+3 to N+4)
G6: (glyph for a char at position N+5)

and we are producing glyphs backward, 'draw' method is given
glyphs in this order:

glyphs from G6 to G6 (both inclusive)
glyphs from G3 to G5 (both inclusive)
glyphs from G1 to G2 (both inclusive)
glyphs from G0 to G0 (both inclusive)

---
Kenichi Handa
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]