1

I am trying to generate PDF from xml using apache Fop, It works fine with english but while i try to disply arabic text the characters are separated as shown in the Image

enter image description here

1- I tried with 2.1, 2.5 and latest stable apache Fop version 2.6

2- I embded the font in Fop config file

3- I enabled complex-scripts

4- I tried with different fonts

but it didn't solve the issue I attached Apache Fop configuration file below

<fop version="1.0">
    <complex-scripts disabled="false" />
    <renderers lang="ar">
        <renderer mime="application/pdf">
            <fonts>
                <font kerning="yes" embed-url="src/main/resources/fonts/trado.ttf" embedding-mode="auto" encoding="UTF-8">
                    <font-triplet name="trado-ar-font" style="normal" weight="normal" />
                </font>
            </fonts>
        </renderer>
    </renderers>
</fop>

I also checked: XSL-FO: displaying Arabic characters and FOP Arabic letter spacing

but there is nothing worked with me appriciate any support please

mshehata
  • 144
  • 8
  • 2
    Can you add the FO markup corresponding to your sample image? For those of us that don't read Arabic, can you also fake an image of what it should look like? – Tony Graham Nov 17 '22 at 10:23
  • I think the `lang="ar"` attribute must be in the FO file, not in the configuration file. – lfurini Nov 17 '22 at 14:13

1 Answers1

0

refrence to https://xmlgraphics.apache.org/fop/2.0/complexscripts.html It was solved by adding script="arab" to the root tag like:

 <fo:root script="arab">
mshehata
  • 144
  • 8