[Fribidi-discuss] Some thoughts about BiDi Quirks Handling
Omer Zak
omerz at actcom.co.il
Sat Sep 21 03:12:02 EST 2002
Due to Microsoft's actions, there are more than one version of BiDi
algorithm in use. The Hebrew versions of different MS-Word versions
implement slightly different BiDi algorithms. I don't know what is the
situation in Arabic and Persian.
In order for AbiWord and other Free Software word processors to fully
replace Microsoft wordprocessors, it must be possible for them to
faithfully import files produced by Microsoft wordprocessors, in *.doc
and/or *.rtf formats.
But in addition to support for those file formats, the Free Software
wordprocessors need to implement compatible BiDi algorithms, so that the
imported documents will look the same in both Microsoft wordprocessors and
in Free wordprocessors.
The question is how to accommodate the above.
Possible approaches:
--------------------
1. Implement few "quirks" flags in FriBidi (the FriBidiEnv structure has
room for those flags). When set, those flags would cause FriBidi to
behave like one of the incompatible BiDi algorithms.
2. Add to FriBidi special code, which would flag the characters in a
string, which would be reordered differently in the different BiDi
algorithms. The wordprocessor would then display those characters in a
different way, and let the user determine whether they were reordered
the way he intended to or not.
3. The import filters, used by the Free wordprocessors to import files
created by a given version of Microsoft wordprocessor, would insert
explicit BiDi overrides at those places where the BiDi algorithms would
produce different visual orderings of characters.
Of the possible approaches, I favor the most the "quirks" flags approach.
When importing a document, the user has anyway to specify which
wordprocessor created it. It is not a big deal to specify also the
corresponding BiDi algorithm version.
In the internal representation of documents used by Free wordprocessors,
an extra field to specify the BiDi algorithm needs to be added. But if
the wordprocessor was designed in a reasonable way, it should not be
difficult to add a paragraph-scope attribute to specify the BiDi algorithm
to be applied to that paragraph. (Note: paragraph scope is needed to
handle the case of an user, who wants to merge together documents created
by different wordprocessors, which used different BiDi algorithms.)
--- Omer
WARNING TO SPAMMERS: see at http://www.zak.co.il/spamwarning.html
More information about the FriBidi
mailing list