Abdelrazak Younes wrote:
Dov Feldstern wrote:
The main problem I see right now with Arabic is that the widths of the
letters are not calculated correctly. This means that letters may not
totally connect with their neighbors, because their glyph doesn't
totally cover the space given to them. (Are you seeing the same
problem?) It sounds like this is related to the metrics calculations
(see
http://thread.gmane.org/gmane.editors.lyx.devel/79740/focus=79928,
although it looks like there has been some work done since then, so
I'm not sure if that is still relevant or not). If that is, in fact,
the case, then I don't think that moving to Qt will help us solve this
problem (correct me if I'm wrong?).
It will help, you can retrieve the proper metrics information thanks to
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.
Abdel.
Would this also allow you to determine the correct position when moving
the cursor over existing text? If so, then if you want to try to let Qt
do this, I'm open to suggestions. I'm still not sure what we'll gain by
letting Qt do it, though.
Also, I think that any discussion of this should take into account *all*
Bidi issues we have. For example, those that I raised in
http://thread.gmane.org/gmane.editors.lyx.devel/80783/focus=80783. We
have to be aware of the fact that our backend (latex) doesn't
necessarily behave exactly according to standard Bidi rules; and we do
have to make sure that the gui and backend behave in the same way;
therefore the fact that we have control over the Bidi algorithm provides
us with more flexibility than we would have if the gui's bidi were not
our own.
And again, there's always the issue to keep in mind of the possibility
of wanting to use a different frontend in the future which doesn't
support bidi in exactly the same way that Qt does...
Dov