Well, [softening my throat] like Ehsan already mentioned, then only trick is to use RTL paragraphs, and not only right-align the paragraph. That solves most of the problem. For the remaining few cases, these things called LRM and RLM should be used.
behdad On Thu, 10 Feb 2005, Ehsan Akhgari wrote: > The problem, as some of you might have guessed, is the direction switching. > Given an application like MS Word, my keyboard correctly sends the > characters, and Word gives them the right form. But sometimes some > characters (mainly the "shared" chars), and often the blinking caret appear > on the wrong side of the line. > > What can be done to make the shared characters (Like "!") to appear on the > correct side? The caret problem can be fixed with Word's RTL command. But > mixing English and Persian letters in the same line often leads to > unpredictable outcomes. > The rule of the thumb is, use RTL paragraphs when writing Persian text > (which might contain English text within it) and use LTR when writing > English text (which might contain Persian text within it.) > > Is there an algorithm governing these situations that I can use to modify > the output to remedy this? > There is an algorithm called Unicode BiDirectional Algorithm, the details of > which is avaibale on Unicode.org. As you might have guessed, Word doesn't > provide a correct implementation of this algorithm (nor do any other text > editors that I know of to this date.) There's a library being developed > called FriBidi, of which Behdad is the project maintainer, IIRC, which might > help you, but not with Word probably. I guess Behdad would be able to make > profound comments on this. > --------- > Ehsan Akhgari > www.farda-tech.com <http://www.farda-tech.com/> > List Owner: <mailto:[EMAIL PROTECTED]> > MSVC@BeginThread.com > [Email: [EMAIL PROTECTED] > [WWW: http://www.beginthread.com/Ehsan ] > --behdad http://behdad.org/ _______________________________________________ PersianComputing mailing list PersianComputing@lists.sharif.edu http://lists.sharif.edu/mailman/listinfo/persiancomputing