docbook-apps

Expand all | Collapse all

Re: [docbook-apps] Persian, Arabic or Hebrew FO output, need to get writing-mode=rl-tb

  • 1.  Re: [docbook-apps] Persian, Arabic or Hebrew FO output, need to get writing-mode=rl-tb

    Posted 11-07-2006 16:59
    There are several opportunities in the stylesheet to set a writing-mode property. It is easier at the global levels. Here are two options:

    1. The root.properties attribute-set is applied to the fo:root element.

    2. The template named set.flow.properties can be customized to add properties to each fo:flow element.

    I have enabled Arabic and Hebew for Antenna House using both methods. In one case, I created a customization for Arabic documents in order to select fonts and adjust formatting for right-to-left alignment. In that case, I put the writing-mode and language properties in the root.properties attribute-set.

    In another case, I used set.flow.properties to select a writing mode, based on the document's lang attribute. I called the template named l10n.language (in common/l10n.xsl) to convert the document's lang attribute to a standard form that matches one of the locale filenames in the common directory (ar for Arabic, for example). Then I used that value to choose a writing mode. I also made sure the language property was set at the top level.

    At the block level, it gets more complicated because there are so many templates that generate blocks. There is no single place to add properties for all fo:block elements.

    The stylesheet does partially support the @dir attribute, but only on inline elements. See fo/inline.xsl for examples.

    Bob Stayton
    Sagehill Enterprises
    DocBook Consulting
    bobs@sagehill.net





  • 2.  Re: [docbook-apps] Persian, Arabic or Hebrew FO output, need to get writing-mode=rl-tb

    Posted 11-21-2006 22:25
    Hi Bob,
    Thank you for you answer! I tried your first approach and it works fine,
    but I have some right-to-left alignment problems,

    1. TOC, I should have from the right side, first the text, the dots
    line and then the page number.
    I found the template in fa/toc.xsl, and put it in my customizing layer
    and changed it,
    but it doesn't work, could not find some variables.
    I need to get in my FO output file, in toc part formatting like this:

    <fo:block text-align-last="justify" text-align="start" end-indent="24pt"
    last-line-end-indent="-24pt">
    <fo:inline keep-together.within-line="always">
    <fo:basic-link internal-destination="intro">
    <fo:page-number-citation ref-id="intro"/>
    </fo:basic-link>
    <fo:leader leader-pattern="dots"
    leader-pattern-width="3pt"
    leader-alignment="reference-area"
    keep-with-next.within-line="always"/>
    </fo:inline>

    <fo:inline keep-with-next.within-line="always">
    <fo:basic-link internal-destination="intro">
    1. ARABIC TITLE
    </fo:basic-link>
    </fo:inline>
    </fo:block>

    2. In "calloutlist", "callout" I should put them to the right side, from
    there, first the number and then the text.
    Can I have them in my customizing layer? I checked the fo/callout.xsl
    file, is this the template name="callout-bug"?

    3. Everywhere in Stylesheet, when it has text-align="left", it should be
    change to "right", and vice versa.

    3. Could Stylesheet support fully the @dir attribute? Or the Stylesheet
    get too complex to support these features.

    I checked all of these with Antenna House and my modified FOP
    trunk-version, and is the same.

    Thank you indeed!
    Kia Teymourian

    Bob Stayton wrote:
    > There are several opportunities in the stylesheet to set a
    > writing-mode property. It is easier at the global levels. Here are
    > two options:
    >
    > 1. The root.properties attribute-set is applied to the fo:root element.
    >
    > 2. The template named set.flow.properties can be customized to add
    > properties to each fo:flow element.
    >
    > I have enabled Arabic and Hebew for Antenna House using both methods.
    > In one case, I created a customization for Arabic documents in order
    > to select fonts and adjust formatting for right-to-left alignment. In
    > that case, I put the writing-mode and language properties in the
    > root.properties attribute-set.
    >
    > In another case, I used set.flow.properties to select a writing mode,
    > based on the document's lang attribute. I called the template named
    > l10n.language (in common/l10n.xsl) to convert the document's lang
    > attribute to a standard form that matches one of the locale filenames
    > in the common directory (ar for Arabic, for example). Then I used
    > that value to choose a writing mode. I also made sure the language
    > property was set at the top level.
    >
    > At the block level, it gets more complicated because there are so many
    > templates that generate blocks. There is no single place to add
    > properties for all fo:block elements.
    >
    > The stylesheet does partially support the @dir attribute, but only on
    > inline elements. See fo/inline.xsl for examples.
    >
    > Bob Stayton
    > Sagehill Enterprises
    > DocBook Consulting
    > bobs@sagehill.net <mailto:bobs@sagehill.net>
    >
    >
    >
    >