Re: Unicode bidi algorithm and editing




swapan@lycosmail.com writes:

>  ---- you wrote: 
> > 
> > I've been working on making GtkEntry handle bidirectional
> > editing, and have come across a few cases where the behavior
> > seems counter-inutiutive and confusing.
> > 
> > One example is when entering a string of text that is counter
> > to the base direction for an entry.
> > 
> > Say, I want to type
> > 
> > "he said, ITS A CAR"
> > 
> > where the capitalized string is in a RTL language, with the
> > base direction being LTR.
> > 
> > After I type:
> > 
> >  "he said, ITS "
> > 
> > then, this is displayed as:
> > 
> >  "he said, STI |"

> Why not make the cursor stationary after the comma and let the
> string move right as you type. Then it will show something like
> this:
>    "he said, | STI"
> The cursor will move to end of the string when you press the mode
> switch key after the RTL string is done.

Yes, this is behavior that would seem more natural to me. It's a bit
of a pain to implement, since it means:

 a) Tracking the keyboard direction. (Right now, I'm ignoring the
    keyboard direction and just paying attention to what
    characters get inserted.) But this probably will be necessary
    in any case.

 b) Effectively including the cursor in the bidirectional algorithm
    with some such rule as:

    - The trailing side of the cursor acts like a character with
      a strong directional property in the direction of the current
      keyboard direction.

    This can most likely can be implemented by temporarily
    inserting characters while determining directional levels,
    and doesn't actually require modification of the bidirectional
    algorithms employed.

So, it's ugly to implement, but if its the right behavior, than we need to 
to implement it anyways. :-(

It also would have the rather odd consequence of white space with the
entry rearranging itself as one moved the cursor through the entry.

Regards,
                                        Owen



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