Firstly install Microsoft Corefonts from http://corefonts.sf.net
$ cd /opt/fop-0.95
$ java -cp 
build/fop.jar:lib/avalon-framework-4.2.0.jar:lib/commons-logging-1.0.4.jar:lib/commons-io-1.3.1.jar:lib/xmlgraphics-commons-1.3.1.jar
 org.apache.fop.fonts.apps.TTFReader /usr/share/fonts/msttcorefonts/arial.ttf 
conf/arial.xml
$ java -cp 
build/fop.jar:lib/avalon-framework-4.2.0.jar:lib/commons-logging-1.0.4.jar:lib/commons-io-1.3.1.jar:lib/xmlgraphics-commons-1.3.1.jar
 org.apache.fop.fonts.apps.TTFReader 
/usr/share/fonts/liberation/LiberationSans-Regular.ttf 
conf/LiberationSans-Regular.xml

$ cat /opt/fop-0.95/conf/fop.conf
<?xml version="1.0"?>
<fop version="1.0">
  <base>.</base>
  <source-resolution>72</source-resolution>
  <target-resolution>72</target-resolution>
  <default-page-settings height="297mm" width="210mm"/>
  <renderers>
    <renderer mime="application/pdf">
      <filterList>
        <value>flate</value>
      </filterList> 
      <fonts>
        <font 
embed-url="file:///usr/share/fonts/liberation/LiberationSans-Regular.ttf">
          <font-triplet name="Liberation Sans" style="normal" weight="normal"/>
        </font>
        <font 
embed-url="file:///usr/share/fonts/liberation/LiberationSans-Bold.ttf">
          <font-triplet name="Liberation Sans" style="normal" weight="bold"/>
        </font>
        <font 
embed-url="file:///usr/share/fonts/liberation/LiberationSans-Italic.ttf">
          <font-triplet name="Liberation Sans" style="italic" weight="normal"/>
        </font>
        <font 
embed-url="file:///usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf">
          <font-triplet name="Liberation Sans" style="italic" weight="bold"/>
        </font>
        <font embed-url="file:///usr/share/fonts/msttcorefonts/arial.ttf">
          <font-triplet name="Arial" style="normal" weight="normal"/>
        </font>
        <font embed-url="file:///usr/share/fonts/msttcorefonts/arialbd.ttf">
          <font-triplet name="Arial" style="normal" weight="bold"/>
        </font>
        <font embed-url="file:///usr/share/fonts/msttcorefonts/ariali.ttf">
          <font-triplet name="Arial" style="italic" weight="normal"/>
        </font>
        <font embed-url="file:///usr/share/fonts/msttcorefonts/arialbi.ttf">
          <font-triplet name="Arial" style="italic" weight="bold"/>
        </font>
      </fonts>
    </renderer>
</fop>

$ cat sample.xml
<fonts>
    <arial>Test AV fi</arial>
    <liberation>Test AV fi</liberation>
</fonts>

$ cat sample.xsl
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:fo="http://www.w3.org/1999/XSL/Format";
    version="1.0">

    <xsl:template match="/">
        <fo:root font-weight="normal" font-style="normal">
            <fo:layout-master-set>
                <fo:simple-page-master master-name="simple" page-height="297mm" 
page-width="210mm" margin-top="0.1in" margin-bottom="0.1in" 
margin-left="0.75in" margin-right="0.75in">
                    <fo:region-body margin-bottom="0.5in" margin-top="0.8in" />
                    <fo:region-before extent="1.25in"/>
                    <fo:region-after extent="0.5in"/>
                </fo:simple-page-master>
            </fo:layout-master-set>

            <fo:page-sequence master-reference="simple" format="1">
                <fo:flow flow-name="xsl-region-body">
                    <xsl:apply-templates/>
                    <fo:block id="last-page"/>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>

    <xsl:template match="arial">
        <fo:block font-family="Arial">
            <xsl:value-of select="."/>
        </fo:block>
    </xsl:template>

    <xsl:template match="liberation">
        <fo:block font-family="Liberation Sans">
            <xsl:value-of select="."/>
        </fo:block>
    </xsl:template>
</xsl:stylesheet>

$ /opt/fop-0.95/fop -c /opt/fop-0.95/conf/fop.conf -xml sample.xml -xsl 
sample.xsl -pdf sample.pdf && evince sample.pdf

I have submitted this with Redhat as well, 
https://bugzilla.redhat.com/show_bug.cgi?id=503430 as it could be the font. 
Though it works correctly in Abiword so decided to post the bug details here as 
well.


      Need a Holiday? Win a $10,000 Holiday of your choice. Enter 
now.http://us.lrd.yahoo.com/_ylc=X3oDMTJxN2x2ZmNpBF9zAzIwMjM2MTY2MTMEdG1fZG1lY2gDVGV4dCBMaW5rBHRtX2xuawNVMTEwMzk3NwR0bV9uZXQDWWFob28hBHRtX3BvcwN0YWdsaW5lBHRtX3BwdHkDYXVueg--/SIG=14600t3ni/**http%3A//au.rd.yahoo.com/mail/tagline/creativeholidays/*http%3A//au.docs.yahoo.com/homepageset/%3Fp1=other%26p2=au%26p3=mailtagline

Reply via email to