02 Jun

Bidi LyX

Saturday June 02nd 2007, 2:31 pm
Tags: , ,

Sometimes one stirs up a hornet’s nest. I just wanted to give a clean way to fix a bug in LyX’s cursor positioning around RTL<->LTR boundaries (some like |SITH EREH, where a line has right-to-left and left-to-right parts). In fact this is quite common if you start writing in a language with RTL layouting and then put in math equations (which of course are left-to-right there). So your cursor is behind the “like” in the example above and then you move right. The question is where the cursor should be. In front of the S or behind the H? The intuitive way probably is that you stay in the LTR segment and place it in front of S. So typing something new will create LTR text.

All this code is very sensistive to +-1 errors and hence it took several iterations to really get it right. Things like painting selection turns from simple rectangle drawing into Finally we got it now and it’s waiting to be committed, hopefully before RC2.

Anyway, I don’t speak or write Hebrew, but by fixing the bug I found more and more inconsistencies in LyX’s RTL handling. So fixing those I spent a whole lot of last week getting the cursor movement right, but also learnt a lot about what it means to depend on software makers to support those thing.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Reddit

No Comments »

No comments yet.

 

RSS feed for comments on this post. TrackBack Website

Leave a comment

(required)

(required)

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>