Abdelrazak Younes wrote:

Oddly enough, the "RTL langauage support" check-box was not set when I took this screenshot. Here's a new screenshot when the RTL support is enabled.
I cannot read Hebrew, Dov, could you tell us which one is correct?

So again, the second screenshot that Abdel sent is the correct one. In other words, the RTL flag *is* important.


and I don't have any idea why we need the \rtl flag in lyxrc. Why is RTL display not derived from the language?


Good question. I guess it should...

I think that the reason for having the flag is just for efficiency: in the end, the direction *is* determined by the language. However, this means that you have to check every single letter to determine whether it belongs to an RTL or LTR language. This is the Bidi algorithm, which was implemented in LyX by Dekel Tsur, and the implementation is LyX is very good. However, it is costly. So if we know that we won't be using RTL languages, it's more efficient to just turn off this flag, and then the whole Bidi algorithm is skipped.

So yes, the direction is ultimately determined by the language, but there's still a point in having the flag.

Just in case you're wondering where all this is in the code: I only just started mapping it out, but basically the Bidi algorithm is implemented in Bidi.C (surprising, no? ;) ). The actual computation takes place in Bidi::computeTables. And the first thing there is to check if the flag is set, and if not, just set an inner flag (don't ask me what the meaning of the name "start_" is), and immediately return, rather than performing the costly calculation.

Dov

Reply via email to