Georg Baum wrote:
Am Sonntag, 25. März 2007 00:12 schrieb Abdelrazak Younes:
Georg Baum wrote:
Dov Feldstern wrote:
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 agree, but I fear it is not possible: The shaping is supposed to happen
after applying the bidi algorithm (according to unicode.org). Since I
believe that we need to do our own bidi stuff (see below). I also think we
need to do our own shaping.
Maybe we could instead find a way to ask Qt what shaping was used? We
can use this method:
int QFontMetrics::charWidth ( const QString & text, int pos ) const
Returns the width of the character at position pos in the string text.
The whole string is needed, as the glyph drawn may change depending on
the context (the letter before and after the current one) for some
languages (e.g. Arabic).
This function also takes non spacing marks and ligatures into account.
* 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.
How would navigation etc be handled when insets are involved?
You mean when an inset is inserted in the middle of a word? This just
break the word in two (like we do now). I believe we shouldn't do more
than that.
I believe
that we need some sort of our own bidi stuff even if we let qt handle bidi
of normal text.
For ordering words I agree, not for ordering letters. Sure, we need to
now if we are inside an RTL word (and Qt gives that info) and we need to
know the char witdh for cursor navigation (and Qt also provide enough
information, see above).
Arabic support is obviously broken
now. But as I haven't done anything up to now, I won't complain.
I fixed that yesterday (at least I think I did), so all that needs to be
done is testing.
I noticed that. I still think we are complicating our life but you are
maybe right that this is good enough for now. Thanks for fixing that anyway.
Abdel.