Welcome back, Abdel!
Abdelrazak Younes wrote:
(1) Paint Hebrew/Arabic characters one at a time, so that Qt's Bidi
algorithm doesn't get applied. This is the easiest solution, and also
the most conservative, and therefore least likely to introduce new bugs.
I think that this is definitely the way to go at least until 1.5.0 is
released. This does have the disadvantage, however, of painting the
characters one at a time, which may be less efficient (does anyone know
if this really makes a significant difference?).
Probably not much.
Good, so that's one less thing to worry about, at least until we can
prove otherwise...
Attached is a patch applying this fix. Hebrew should now work even with
real, legal, locale settings! (I haven't tested the Arabic at all, I
have never used Arabic in LyX and have no idea what the current state
is, or what it ever was. I also am not currently set up for testing
Arabic, and I'm not sure how one would go about it. I'd be happy to get
any input on this.)
Each and every arabic letter has a different shape if it is at the
beginning, the middle or the end or a word. So it would really be better
to let Qt handle that really.
I am aware of that, but I think it shouldn't be too hard to take care
of. I promise to take a look at it, but it may take a while...
Basically, if you'll look in the piece of code which I changed, the
arabic section calls paragraph::transformChar --- that's the function
which takes care of choosing the correct form of each letter, depending
on it's position in the word. In the end, this also boils down to the
tedious changing of the encodings, very similar to what needs to be done
to the ComposeChar functions --- it's just a table that needs to be
filled out...
I can tell you that isComposeChar_arabic and isComposeChar_hebrew are
definitely wrong. They still assume the old encodings. Fixing them is
easy,
but tedious:
There is no need for fixing, just for deleting.
I'll take a look at this sometime, don't delete them just yet...
[...]
* I'm not sure that using Qt's Bidi would mean that we wouldn't need
to use our own anyhow. We'd still need to know how things look on the
screen, for laying out insets; for cursor movements across the screen;
etc. So would we really be able to just use Qt's bidi?
I agree with you here, this last point being the main reason.
I still disagree and still think we should let Qt decide at word level
and disable the LyX bidi code there. Arabic support is obviously broken
now. But as I haven't done anything up to now, I won't complain.
Good. ;)
Seriously, two things:
a. I promise to take a look at the Arabic code, I'd like to see it
working, too, and I think it won't be too much trouble. But it'll take
me some time --- I just started a new full-time job a couple of months
ago...
b. If/when you have time to play around with letting Qt do everything,
then we can consider it. But I think you'll discover that we'll still
need most of our Bidi code even if you do let Qt take care of the
painting, and that it will be a lot of work, without much gain.
Abdel.