XSL-FO: displaying Arabic characters

萝らか妹 提交于 2021-01-03 05:52:15

问题


Please, I have a problem displaying the Arabic language in my reports generated in PDF format using the api fop 1.0 (XSL-FO).
I configured a userConfig.xml for using Arial.ttf font. everything works fine except that characters are displayed separately.
example: ت ق و ل instead of تقول
I put spaces only to explain to you.

<fo:block-container font-size="12pt" writing-mode="rl-tb"  xml:lang="ar" font-family="Arial" xmlns:fo="http://www.w3.org/1999/XSL/Format" >
<fo:block>
تقول
</fo:block>
</fo:block-container>

I tried to use the tag but its contents do not appear in the generated doc.

<fo:block text-align="center"> 
<fo:inline direction="rtl" language="ar" unicode-bidi="embed">
تقول
</fo:inline>
</fo:block>

userConfig.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!-- Arial Unicode only -->
<fop version="1.0">
  <renderers>
   <renderer mime="application/pdf">
       <fonts>
           <!-- register a particular font -->
           <font kerning="yes"
                 embed-url="file:///C:\windows\arial.ttf"
                 encoding-mode="single-byte">
               <font-triplet name="Arial" style="normal" weight="normal"/>
           </font>
       </fonts>
   </renderer>
</renderers>
</fop>
  • head of my xsl

Thank you.


回答1:


Support for Arabic and other complex scripts may be disabled in FOP, see FOP complex scripts.

If they are enabled, setting lang="ar" should be enough.

complex-scripts-disabled should be 'false'



来源:https://stackoverflow.com/questions/49532386/xsl-fo-displaying-arabic-characters

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!