Re: Automatic paragraph direction in gtktextlayout



Each paragraph should be decided independently whether it is RTL
or LTR. Only if there are no strong characters in the paragraph 
(E.g. a single line containing the "> " string), will the direction
be according to the the previous paragraph. Of course the user 
can modify the direction by insertion of a RLM or LRM zero-width
unicode control character. 

About switching the direction according to the keyboard map, I
don't think it is possible. As far as I understand the text widget
has no information of the keyboard layout at all, and only responds
to characters that are input. As switching the keyboard layout is
done internally inside server, I don't think it generates
any event that may be caught and identified by the widgets. Also, as 
far as I understand, it is not possible to have the widgets request a 
change in keyboard layout that might be desirable by clicking on
a strong LTR or RTL character. I am not sure about this though,
as I'm not an expert on gdk, and would be happy to be proven wrong.

Regards,
Dov

On Sun, Sep 30, 2001 at 01:03:32PM +0300, Uri David Akavia wrote:
> On Sun, 2001-09-30 at 00:32, dov imagic weizmann ac il wrote:
> > I've been thinking about changing the textlayout widget to add the
> > option of "automatic" paragraph directionality. The change is more in
> > the spirit of unicode than is the current implementation. Now the
> > paragraph direction is determined either by the global textlayout
> > direction, or overridden through a style. The idea is that the first
> > strong character (according to the Unicode classification) of each
> > paragraph should determine the paragraphs direction as either LTR or
> > RTL. In case there is no strong character in the paragraph, then
> > either using the last paragraph's directionality or the global
> > textviewing direction should be ok.
> 
> This seems logical. Just so I'm sure what will happen - If I started
> writing in RTL, then all paragraphs will be RTL until I tell them
> differently?
> If so, then great.
> Responding to the carachter sounds logical, but I'll have to see it in
> action before I can decide if I like it or not (grin).
> BTW, will switching the language be connected to switching the
> direction? Can it be connected? (Automagically switching to hebrew, and
> to RTL paragraph) Applying such a patch would connect them, will they be
> connected without this patch?
> All in all, sounds like a good idea.
> 
> 
> Uri David




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