After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 124825 - Justificati18n problems @gtk.Text{Buffer,View}
Justificati18n problems @gtk.Text{Buffer,View}
Status: RESOLVED DUPLICATE of bug 120256
Product: gtk+
Classification: Platform
Component: Widget: GtkTextView
2.2.x
Other All
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-10-17 10:36 UTC by Yotam Medini
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tar.gz with Makefile + just.{cc,py} demo programs (3.77 KB, application/octet-stream)
2003-10-17 10:38 UTC, Yotam Medini
Details

Description Yotam Medini 2003-10-17 10:36:14 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).
Comment 1 Yotam Medini 2003-10-17 10:38:26 UTC
Created attachment 20759 [details]
tar.gz with Makefile + just.{cc,py} demo programs
Comment 2 Matthias Clasen 2004-02-02 10:49:28 UTC
Might be good to look at this together with the outstanding Pango 
changes for RTL.
Comment 3 Owen Taylor 2004-03-13 17:47:52 UTC
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 ***