metrics-url and embed-url requires a URL, not a filename. Please note that starting with FOP 0.95 you can omit the metrics-url attribute. The XML font metrics step is no longer required. So, changing "/test/ParisineOffice-Regular.ttf" to "file:/test/ParisineOffice-Regular.ttf" should do it.
On 16.02.2010 12:35:14 philippe voncken wrote: > Hello, > > I want loading a font with fop. Font is Parisine Office. I generated xml > files with following command: > > 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:lib/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 > > Xml files are generating. ~500Ko per files. > > I'm using following file to configure my fop: > <fop version="1.0"> > <renderers> > <renderer mime="application/pdf"> > <filterList> > <!-- provides compression using zlib flate (default is on) --> > <value>flate</value> > </filterList> > <fonts> > <font metrics-url="/test/ParisineOffice-Regular.xml" kerning="yes" > embed-url="/test/ParisineOffice-Regular.ttf"> > <font-triplet name="Parisine Office" style="normal" > weight="normal"/> > </font> > <font metrics-url="/test/ParisineOffice-Bold.xml" kerning="yes" > embed-url="/test/ParisineOffice-Bold.ttf"> > <font-triplet name="Parisine Office" style="normal" > weight="bold"/> > </font> > <font metrics-url="/test/ParisineOffice-Italic.xml" kerning="yes" > embed-url="/test/ParisineOffice-Italic.ttf"> > <font-triplet name="Parisine Office" style="italic" > weight="normal"/> > </font> > <font metrics-url="/test/ParisineOffice-BoldItalic.xml" > kerning="yes" embed-url="/test/ParisineOffice-BoldItalic.ttf"> > <font-triplet name="Parisine Office" style="italic" > weight="bold"/> > </font> > </fonts> > </renderer> > </renderers> > </fop> > > When I generate the Pdf in xslfo with fop, I'm this exception: > [INFO] javax.xml.transform.TransformerException: 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] 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 > > > Any ideas ? > > regards, > philippe Jeremias Maerki --------------------------------------------------------------------- To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org