Micha Feigin wrote:
Also, what is the difference between all of these? Mainly LRE vs. LRO areI can't explain it in details without referring you to the full Unicode annex dealing with BiDi. Since there is no reason for you to fully read and understand the 20 something points of the full algorithm, I'll just summarize.
puzzling.
LRM and RLM are merely zero width characters with distinct (strong) directionality. In that respect, they are no different than "A" or "×" respectively. They do affect the way BiDi works, which is why they are useful. For example, certain characters appear in different locations (or even differently) depending on their relative position to strong characters. LRM and RLM can be used to change that meaning.
LRO and RLO, in effect, disable the BiDi algorithm. Anything between LRO and PDF will be rendered character by character from left to right, regardless of directionality of actual character. Likewise, anything between RLO and PDF will render right to left.
LRE and RLE are the most interesting. They are also the most potentially useful, though I find it hard to think of a non-human managing to emit them correctly. Anything between LRE and PDF will be treated as if it's in a English paragraph, regardless of directionality of the original paragraph. I'll give you an example of when it's useful. As usual, lowercase denotes Latin while uppercase denotes Hebrew.
Logical order:
in sentences like "THE WORD english IS SAID ENGLISH", latin words are typically written as is.
Visual order without modifications:
in sentences like "DROW EHT english HSILGNE DIAS SI", latin words are typically written as is.
This is totally incorrect. The Hebrew runs appear in the wrong order around the latin word "english". This is because the paragraph, on the whole, is an English one, while the sentence in quotes should have been in a Hebrew paragraph.
However, if we change the logical sentence to say:
in sentences like "<RLE>THE WORD english IS SAID ENGLISH<PDF>", latin words are typically written as is.
Visual order:
in sentences like "HSILGNE DIAS SI english DROW EHT", latin words are typically written as is.
We get correct rendering. We are essentially telling the BiDi algorithm that the sentence in quotes is a separate sentence, and that it is a sentence with right to left directionality.
Shachar
-- Shachar Shemesh Lingnu Open Source Consulting ltd. http://www.lingnu.com/
================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]
