Next in thread → Next in month →

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

From
Bob Stayton <>
Date
2006-11-07T16:59:20+00:00
ID
002701c7028e$041a1be0$6400a8c0@totoro
Thread
Re: [docbook-apps] Persian, Arabic or Hebrew FO output, need to get writing-mode=rl-tb


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


 

 

  
----- Original Message ----- 

  
From: 
  Kia 
  Teymourian 

  
To: Bob Stayton 

  
Cc:  
  

  
Sent: Tuesday, November 07, 2006 5:42 
  AM

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

  

Hi Bob,

thank for your answer! Actually I am working 
  on a patch for Apache FOP so that fop 
will be able to create well-formated 
  Persian, Arabic or Hebrew output files.
My aim is to have open source 
  documentation system for languages like Arabic 
with complex text layout 
  writing system. 

On my FOP trunk version, I can create Arabic PDF 
  files
like this one
http://user.cs.tu-berlin.de/~kiat/fop/TestOutPut.pdf
but 
  I should have in my FO files the correct writing system. The problem is not 
  just having the correct shapes 
and glyphs but it should be able to apply 
  Bidi Algorithm on each paragraph. 

Antenna House's XSL Formatter needs 
  also to have writing-mode="rl-tb": 
  

<fo:block-container
writing-mode="rl-tb"
font-family="Tahoma"
language="ar">
<fo:block>

Arabic 
  Arabic 
  Arabic

</fo:block>
</fo:block-container>

Can I 
  control this by my customizing layer? Is this implemented depending on 
  writing-mode "dir" attribute?   

Kindest regards,

Kia 
  Teymourian

Bob Stayton wrote: 
  
    
    

    
Hi Kia,

    
It would help if you mentioned what XSL-FO 
    processor you are using. If it is FOP, then you are out of luck, because FOP 
    doesn't support writing-mode properties that enable you to publish Hebrew or 
    Arabic.  

    
 

    
If you use RenderX's XEP or Antenna House's XSL 
    Formatter, then you can publish Hebrew and Arabic, and it is easier than you 
    think.  The Unicode ranges for those languages identify the glyphs 
    as needing to be set right-to-left, so the formatter will do so 
    automatically without having to set writing-mode or use 
    bidi-override.

    
 

    
Bob Stayton
Sagehill Enterprises
DocBook Consulting


    
 

    
 

    
      
----- 
      Original Message ----- 

      
From: 
      Kia 
      Teymourian 

      
To: 
       
      

      
Sent: 
      Sunday, November 05, 2006 3:48 AM

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

      

Hi,
could you please tell me how can I get in my .FO 
      output file, the attribute writing-mode="rl-tb"? 
I need to have in my 
      .FO file something like this:

<fo:block 
      font-size="14pt"  font-family="Tahoma"  line-height="14pt"  
      
  space-after.optimum="12pt"   writing-mode="rl-tb" 
      >
   
      &#x62a;&#x6cc;&#x645;&#x648;&#x631;&#x6cc;&#x627;&#x646; 
      
</fo:block>

I send my XML file with dir="rtl" attribute 
      to the XSLT processor, and the dir="rtl" is 
      just once defined in the root tag
<book dir="rtl">  or 
      <article dir="rtl">. 
Is this feature 
      implemented? 
Or should I add this part in my customizing 
      layer?

How can I get <fo:bidi-override> objects in my .FO output? Is bidi-override 
      implemented?

Thanks, 
Kia 
  Teymourian
Next in thread → Next in month →