Problème de chargement de Police avec Fop

philippe voncken <[email protected]> Tue, 16 Feb 2010 11:13:25 +0100
Newsgroups gmane.text.xml.french.tech
Message-ID <[email protected]>
Bonjour,
J'ai besoin de charger une police particuli=C3=A8re pour g=C3=A9n=C3=A9re=
r des document PDF
avec Fop d'apache.

Il s'agit de la police Parisine Office. J'ai g=C3=A9n=C3=A9r=C3=A9 les fi=
chiers Xml avec la
commande suivante:
java -cp
build/fop.jar:lib/avalon-framework-4.2.0.jar:lib/xml-apis-1.3.04.jar:lib/=
xercesImpl-2.7.1.jar:lib/xalan-2.7.0.jar:lib/commons-logging-1.0.4.jar:li=
b/commons-io-1.3.1.jar:lib/xmlgraphics-commons-1.3.1.jar:lib/serializer-2=
.7.0.jar
org.apache.fop.fonts.apps.TTFReader /test/ParisineOffice-Regular.ttf
/test/ParisineOffice-Regular.xml

Les fichiers Xml ont bien =C3=A9t=C3=A9 g=C3=A9n=C3=A9r=C3=A9s. Ils sont =
assez gros d'ailleurs
environ 500Ko chacun (regular, bold, italic, et bolditalic)

J'ai utilis=C3=A9 le fichier suivant pour configurer fop avec cette polic=
e:
<fop version=3D"1.0">
  <renderers>
    <renderer mime=3D"application/pdf">
      <filterList>
        <!-- provides compression using zlib flate (default is on) -->
        <value>flate</value>
      </filterList>
      <fonts>
        <font metrics-url=3D"/test/ParisineOffice-Regular.xml" kerning=3D=
"yes"
embed-url=3D"/test/ParisineOffice-Regular.ttf">
          <font-triplet name=3D"Parisine Office" style=3D"normal"
weight=3D"normal"/>
        </font>
        <font metrics-url=3D"/test/ParisineOffice-Bold.xml" kerning=3D"ye=
s"
embed-url=3D"/test/ParisineOffice-Bold.ttf">
          <font-triplet name=3D"Parisine Office" style=3D"normal"
weight=3D"bold"/>
        </font>
        <font metrics-url=3D"/test/ParisineOffice-Italic.xml" kerning=3D"=
yes"
embed-url=3D"/test/ParisineOffice-Italic.ttf">
          <font-triplet name=3D"Parisine Office" style=3D"italic"
weight=3D"normal"/>
        </font>
        <font metrics-url=3D"/test/ParisineOffice-BoldItalic.xml"
kerning=3D"yes" embed-url=3D"/test/ParisineOffice-BoldItalic.ttf">
          <font-triplet name=3D"Parisine Office" style=3D"italic"
weight=3D"bold"/>
        </font>
      </fonts>
    </renderer>
  </renderers>
</fop>

Lors de la g=C3=A9n=C3=A9ration Pdf fop me renvoie l'Exception suivante:
[INFO] javax.xml.transform.TransformerException: java.lang.RuntimeExcepti=
on:
Cannot load font: After URI resolution, the returned Source object does n=
ot
contain an InputStream or a valid URL (system identifier) for metrics fil=
e:
/home/philippe/accessio-conf/ParisineOffice-Regular.xml
[INFO] Caused by: java.lang.RuntimeException: Cannot load font: After URI
resolution, the returned Source object does not contain an InputStream or=
 a
valid URL (system identifier) for metrics file:
/home/philippe/accessio-conf/ParisineOffice-Regular.xml

[INFO] java.lang.RuntimeException: Cannot load font: After URI resolution=
,
the returned Source object does not contain an InputStream or a valid URL
(system identifier) for metrics file:
/home/philippe/accessio-conf/ParisineOffice-Regular.xml


Quelqu'un aurait-il une piste pour r=C3=A9soudre ce probl=C3=A8me ?

Cdt,
philippe