Fonts in Linux environment

Hi

I am creating a PDF in my application using XSL:FO

Following are working perfectly in Windows server but when I deploy in linux
environment, the generation fails.

FOP Version : 0.95

*Config file *
<fonts>
 <!-- Windows Dev environment configuration
          <font metrics-url="/Arial.xml" kerning="yes"
embed-url="file:///C:/WINDOWS/Fonts/arial.ttf">
          <font-triplet name="Arial" style="normal" weight="normal"/>
          <font-triplet name="ArialMT" style="normal" weight="normal"/>
          <font-triplet name="arial" style="normal" weight="normal"/>
        </font>
       <font metrics-url="/ArialB.xml" kerning="yes"
embed-url="file:///C:/WINDOWS/Fonts/arialbd.ttf">
          <font-triplet name="Arial" style="normal" weight="bold"/>
          <font-triplet name="ArialMT" style="normal" weight="bold"/>
          <font-triplet name="arial" style="normal" weight="bold"/>
        </font>     -->
<!-- UAT Configuration        -->
   <font metrics-url="/Arial.xml" kerning="yes"
embed-url="/usr/openwin/lib/X11/fonts/TrueType/Arial.ttf">
          <font-triplet name="Arial" style="normal" weight="normal"/>
          <font-triplet name="ArialMT" style="normal" weight="normal"/>
          <font-triplet name="arial" style="normal" weight="normal"/>
        </font>
       <font metrics-url="/ArialB.xml" kerning="yes"
embed-url="/usr/openwin/lib/X11/fonts/TrueType/Arial-Bold.ttf">
          <font-triplet name="Arial" style="normal" weight="bold"/>
          <font-triplet name="ArialMT" style="normal" weight="bold"/>
          <font-triplet name="arial" style="normal" weight="bold"/>
       </font>
       <auto-detect/>
      </fonts>

*In XSL file*
For Normal display
                            <fo:block xsl:use-attribute-sets="Arial11"
xmlns:st1="urn:schemas-microsoft-com:office:smarttags">
                                <fo:leader/>
                            </fo:block>
For Bold Display

                            <fo:block xsl:use-attribute-sets="Arial11"
font-weight="bold" xmlns:st1="urn:schemas-microsoft-com:office:smarttags">
                                <fo:leader/>
                            </fo:block>

  <xsl:attribute-set name="Arial11" >
      <xsl:attribute name="font-size">0.95em</xsl:attribute>
      <xsl:attribute name="font-family">Arial</xsl:attribute>
      <xsl:attribute name="display-align">center</xsl:attribute>
      <xsl:attribute name="language">EN-US</xsl:attribute>
  </xsl:attribute-set>
*
On Console*

[2008-12-02 12:23:01,915] [pool-1-thread-12] ERROR FopDocumentRenderSystem -
javax.xml.transform.TransformerException: org.xml.sax.SAXException:
Mismatch: page-sequence (http://www.w3.org/1999/XSL/Format) vs. root (
http://www.w3.org/1999/XSL/Format)
Exception in thread "pool-1-thread-12"
com.marsh.itg.ddeepa.services.contract.bobject.exception.LogicExecutionException:
org.xml.sax.SAXException: Mismatch: page-sequence (
http://www.w3.org/1999/XSL/Format) vs. root (
http://www.w3.org/1999/XSL/Format)
        at
com..blogic.document.utils.FopDocumentRenderSystem.renderDocument(FopDocumentRenderSystem.java:164)
        at
com..blogic.document.utils.RenderSystemDocumentRenderer$RenderSystemInputStreamProvider$1.run(RenderSystemDocumentRenderer.java:75)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)

Metrics URL is created using the following command

java -cp
./fop-0.95-1.jar:./xmlgraphics-commons-1.3.1.jar:commons-logging-1.0.4.jar:./commons-io-1.3.1.jar
org.apache.fop.fonts.apps.TTFReader  -enc ansi
/usr/openwin/lib/X11/fonts/TrueType/Arial.ttf Arial.xml

I tried to generate the file using with and without the -enc option. On
windows I found that only the file created with -enc works. Without the
option I get font error when PDF is generated on Windows and only dots
appear.

The autodetect feature loads all the fonts but substitute with "any" before
displaying.

Please help me with this issue. I have spent hours on it without any
success.

Thanks

Regards
Ashish Baijal

Received on Tuesday, 2 December 2008 18:56:49 UTC