Re: XSL-FO and foreign language.
- Thank U for the detail answer. From my tests with out ( With several
renderes ) with out specifaing the correnct tags the mixed Hebrew
English text will be ;-( . Maybe in the future this process will be
not need this.
--- In XSL-FO@yahoogroups.com, "W. Eliot Kimber" <ekimber@i...> wrote:
> LuzErez wrote:
> > Hi all
> > I have a general question regarding XSL-FO. The concept that the
> > direction is in the tags: " unicode-bidi="embed" is not clear to
me. I build
> > a system that knows to export XSL-FO or I am using XML stream as
> > source. How do I know if my user keyed in one of the application
> > Hebrew or Arabic? Maybe my external XML has Arabic in it ?
Should I use the
> > " unicode-bidi " in every text element?
> Definitely you should not use unicode-bidi in every text element.
> The first key is that Unicode has built-in directionality
> such that a Unicode-aware, directionality-aware processor should be
> to detect the inherent directionality of any sequence of characters.
> The second key is that Unicode defines a
> algorithm" by which applications can determine how to correctly
> text that mixes left-to-right and right-to-left characters. Most of
> time this algorithm produces correct results, assuming it's
> implemented (which is a big if).
> With respect to getting the correct layout in FO, there are three
> possible cases with respect to directionality:
> 1. A document consists of content that is all of one directionality
> (e.g., all Latin script, all Arabic script, all ideographic
> 2. A document consists of mostly left-to-right script with some
> right-to-left script, such as an English document with quoted
> 3. A document consists of mostly right-to-left script with some
> left-to-right script, such as Hebrew document with some English
> In the first case all that should be required is to set the
> writing-mode where necessary in order to get the correct layout.
> Unicode directionality information will be sufficient for the
> to compose the character content correctly.
> In the second and third cases in most of the time you need do
> special because again the Unicode directionality and the Unicode
> bidirectional algorithm will produce the correct result (at least
> those FO processors that implement the Unicode bidi algorithm).
> The only place where bidi-override should be necessary is where you
> to get a result that is different from the result that would be
> by the application of the Unicode bidi algorithm or different from
> your renderer produces (for whatever reason).
> The biggest problems I've run into are when right-to-left text is
> with both arabic digits and punctuation or bracketing characters--
> these cases the default result is almost never right, either
> the way the bidi algorithm works or because of bugs in a particular
> Also, the fo:bidi-override element is functionally equivalent to
> Unicode directionality control characters, \u202b through \u202e,
> fact some, if not all, implementations simply translate fo:bidi-
> into the equivalent control characters. Therefore it may be easier
> just use these control characters where you need them, especially
> directionality control needs to span FO boundaries.
> The best thing to do is create some test FO instances and see what
> get--that will tell you whether you need to do more work to get the
> correct result in the output.
> W. Eliot Kimber
> Professional Services
> Innodata Isogen
> 9390 Research Blvd, #410
> Austin, TX 78759
> (512) 372-8122