GNOME Bugzilla – Bug 124825
Justificati18n problems @gtk.Text{Buffer,View}
Last modified: 2011-02-04 16:16:03 UTC
Looks like there are problems with (or my misuse of - please let me know) Gtk+'s TextBuffer/TextView regarding paragraph layout and especially justification when using parameters controlling: + Bidirectional editing + Line wrapping + Justification Note: this was reported in http://mail.gnome.org/archives/gtk-i18n-list/2003-October/msg00019.html Owen Taylor suggested me to report it here (bugzilla.gnome) with a C version demo program. http://mail.gnome.org/archives/gtk-i18n-list/2003-October/msg00027.html So I wrote a C++ just.cc, equivalent to the Python-PyGtk just.py sent to gtk-i18n-list. I will soon attach the just.tgz file with the programs+Makefile. The problems that can be demonstrated are: + When running: ./just -dir rtl Indeed the first Hebrew 'Aleph' letter is shown on the right, But justification is still LEFT, and editing is still LTR. This is 'solved' by running: ./just -dir rtl -wrap word One can only wonder why wrapping-mode effects the justification. + Trying to control specific justification of each of the two paragraphs: ./just.py -justpar1 left -justpar2 left ./just.py -justpar1 right -justpar2 right ./just.py -justpar1 left -justpar2 right ./just.py -justpar1 right -justpar2 left all result with the same (LEFT) behavior. Adding '-dir rtl' option to the above 4 does nothing. But with '-wrap char' or '-wrap word' Once can see the expected desired 2x2=4 justification-combinations ./just.py -wrap char -justpar1 left -justpar2 left ./just.py -wrap char -justpar1 right -justpar2 right ./just.py -wrap char -justpar1 left -justpar2 right ./just.py -wrap char -justpar1 right -justpar2 left + But adding the '-dir rtl' option to the last 4 'successful' behavior inverts the desired justification. For example, running: ./just.py -dir rtl -wrap char -justpar1 right -justpar2 left Justifies the 1st paragraph to the _left_, and justifies the 2nd paragraph to the _right_. The Makefile compiles the C++ just.cc program. Note that even it is C++, it calls Gtk+ C-API directly (not Gtkmm nor Inti).
Created attachment 20759 [details] tar.gz with Makefile + just.{cc,py} demo programs
Might be good to look at this together with the outstanding Pango changes for RTL.
I think this is a combination of "working as expected" and a duplicate of bug 120256. There have been a lot of changes in GTK+-2.4 with bidi editing.. We'll probably change things a bit more for GTK+-2.6, but you should in any case check again with GTK+-2.4 when it comes out. The interpretations of GTK_JUSTIFY_LEFT and GTK_JUSTIFY_RIGHT depend on the resolved base direction for each paragraph; this is certainly confusing in some circumstances, but has the advantage of making non-RTL-aware applications generally work as expected. *** This bug has been marked as a duplicate of 120256 ***