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

GTK+ BiDi text widget (was: Reinventing the wheel)



On Mon, Mar 13, 2000 at 01:54:01PM +0200, Moshe Zadka wrote:
> On Mon, 13 Mar 2000, Ilya Khayutin wrote:
> 
> > A better option I think is to add hebrew
> > support, build-in, into GTK+.
> 
> That idea clicked right home. It should be possible to handle the whole
> right left problem entirely within a variant on the Gtk+ text-widget.
> Are there any Gtk+ hackers here who want to discuss that idea somewhere
> (Say, a dedicated mailing list, hebrew-gtk?) This might get a bit
> techinical and specific for this list...)

Current GTK input widgets are gtkentry (=single-line input fields)
and gtktext (=multiline input fields). Those widgets are only
suited for single-font input, not rich text.

On this occasion, get my tweaks to Dov's latest hack
on gtktext widget (the multiline one - gtkbiditext-0.0.1.tar.gz).
I've removed the hebrew keyboard mapping part and the
Alt-Shift mode switching (which should be implemented
with Xkb in the RIGHT way).
I've been using it very well with gnp and GnomeICU for now.
Now overloads existing widgets (via LD_PRELOAD), not
working as a separate widget. Based on GTK+-1.2.4 :(

ftp://ftp.galanet.net/linux/hebrew/gtkbidi-0.0.1.tar.gz

Those are my Xkb settings in XF86Config:
XkbSymbols      "us(pc104)+he+group(shift_alt_toggle)"

I little fixed "he" mappings not to contain include "us(pc104)"
nor the mode locking keys - neither do belong there.
BTW; The Xkb stuff isn't X compliant yet. The hebrew characters gotta
be in the X "sorta-unicode-charset" as said in <X11/keysymdef.h>,
and translated via X calls using the current LOCALE's charset -
that's as far as I understood.

ftp://ftp.galanet.net/linux/hebrew/xkb.hebrew.tar.gz

> Topics on the agenda:
> 1. Adding Unicode support for text-widget
Proper and full unicode is a mission to Pango (previously
called GScript). Look it up in freshmeat.

Anyhow, as I understand, proper BiDi widget in GTK+ should be:
- modifying the widget/function which prints text,
  to reverse if font's charset is ISO-8859-8 (just as Windows
  reverses if the text's written in "hebrew font" but not with,
  assumingly ISO-8859-1, "web fonts").
- modify the editing widgets to store the cursor
  as a "pseudo-character". This should be the Unicode "pseudo"
  character which doesn't break direction and does not display.
  I'm pretty sure such one exists.
- In Logical, cursor travelling works just like with english,
  and thus if fribidi reverses the text "on-display", it would
  also place the cursor "character" in the right place on
  display.
- Selecting text might still be a little more problem.

On a little different matter:
I'm trying to figure out whether when having multiple languages
with multiple X keyboard mappings, can (and should?) xkb handle
them all via ISO_Next_Group etc. modifiers or the proper way
is to have an external proggie handle the language switches?
(I'm looking for the "right way to do it" :)

-- 
Best regards,
Ilya Konstantinov a.k.a Toastie
[http://toast.demon.co.il]

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il