docbook-apps

  • 1.  Re: [docbook-apps] Writing mode, xsl-fo output

    Posted 04-01-2011 23:51
    Hi Mike,
    Yes, my answer was the brief version, and you are right, is not that simple. In my
    experience with formatting Hebrew and Arabic texts, I have found that Antenna House
    and XEP handle the Unicode direction and mixing of punctuation quite well *except*
    with inline text that mixes direction, particularly when an English phrase or word is
    mixed in with a rtl text and there is punctuation at the boundary between directions.
    In those cases where the formatter does not automatically get it right, you sometimes
    have to force the correct order. The following custom template worked well in those
    cases, allowing the author to put the English text and its punctuation inside <phrase
    @lang="en"> so the stylesheet could apply the template:

    <xsl:template match="phrase[@lang = 'en']">
    <fo:bidi-override language="en"
    unicode-bidi="embed"
    direction="ltr">
    <xsl:apply-templates/>
    </fo:bidi-override>
    </xsl:template>

    This template forces whatever is in the phrase element to be formatted ltr, regardless
    of the Unicode range.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net





  • 2.  Re: [docbook-apps] Writing mode, xsl-fo output

    Posted 04-02-2011 05:49
    On Fri, 1 Apr 2011 16:51:19 -0700
    "Bob Stayton" <bobs@sagehill.net> wrote:

    . In those cases where the formatter does not automatically
    > get it right, you sometimes have to force the correct order. The
    > following custom template worked well in those cases, allowing the
    > author to put the English text and its punctuation inside <phrase
    > @lang="en"> so the stylesheet could apply the template:
    >
    > <xsl:template match="phrase[@lang = 'en']">
    > <fo:bidi-override language="en"
    > unicode-bidi="embed"
    > direction="ltr">
    > <xsl:apply-templates/>
    > </fo:bidi-override>
    > </xsl:template>
    >
    > This template forces whatever is in the phrase element to be
    > formatted ltr, regardless of the Unicode range.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > bobs@sagehill.net

    Perfect solution Bob.
    (And thanks for the explanation Tony)




    --

    regards

    --
    Dave Pawson
    XSLT XSL-FO FAQ.
    http://www.dpawson.co.uk