xsl-list
[Top] [All Lists]

[xsl] BIDI problem in XSL-FO

2016-04-29 13:05:05
Dear experts,

The processing done by an FO formatter for right-to-left (RTL) languages is 
nearly magic, considering what happens if you just set

writing-mode="rl-tb"

I really enjoy my first project with Arabic text. Interestingly the problem at 
hand are English words. In the glossary of an RTL document I suddenly have a 
full paragraph full of latin characters:

<fo:block>Brand name (Former name)</fo:block>

This is visually rendered like this:

(Brand name (Former name

I have looked at

* Unicode BIDI Processing <http://www.w3.org/TR/xsl/#d0e4879>
* Unicode BIDI algorithm <http://www.unicode.org/reports/tr9/>

I now understand that there are strong and weak characters. The sequence of 
strong Latin characters with embedded 'weak' spacing and punctuation is 
rendered LTR, the closing 'weak' parenthesis is treated as RTL, because this is 
the default orientation of the paragraph.

My first idea is to add <fo:bidi-override direction="ltr"> to each block or 
maybe only each text node that consist of solely non-Arabic characters. I guess 
this could be done using a regular expression like

not(matches($text, '\p{Arabic}'))

Do you have any other recommendations or best practices?

Thanks,

- Michael
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] BIDI problem in XSL-FO, Michael Müller-Hillebrand mmh@docufy.de <=