Justificati18n problems @gtk.Text{Buffer,View}

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

The attached small Python programs (just.py) tested with 
   gtk=(2, 2, 1), pygtk=(1, 99, 16)
when run without parameters, nicely shows two small boring paragraphs.
Running with '-help' gives a 'usage message':
      [-dir <ltr | none | rtl>]
      [-wrap <char | none | word>]
      [-justpar1 <justification>]
      [-justpar2 <justification>]

      <justification> := <center | fill | right | left>

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_.

regards -- yotam

Attachment: just.py
Description: Binary data

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