W3C home > Mailing lists > Public > www-xsl-fo@w3.org > February 2009

problemsin register a font

From: <Barbara.Bruni@external.bnlmail.com>
Date: Fri, 13 Feb 2009 15:35:24 +0100
Message-ID: <9CE2D1EFBBC4CD4FA21065C2CE454D8D0321E1B4@GEOVSEX14.dip.banca.bnl.it>
To: <www-xsl-fo@w3.org>
hi all, i'm new in FOP
i need to use the "Arial Narrow" font inside my PDF, but my registration
doesn't work
this is my code:
Driver driver = new Driver();
String userConfig =
File userConfigFile = new File(userConfig);
Options options = new Options();
Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_WARN);
OutputStream out = new java.io.FileOutputStream(pdf);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xsl));
Source src = new StreamSource(xml);
Result res = new SAXResult(driver.getContentHandler());
transformer.transform(src, res);
and this is my userconfig.xml
    <font metrics-url="file:///C:/ws/pdf/WebContent/font/arialn.xml
<file:///C:/ws/pdf/WebContent/font/arialn.xml> " kerning="yes"
<file:///C:\windows\fonts\ARIALN.TTF> ">
      <font-triplet name="Arial" style="normal" weight="normal"/>
      <font-triplet name="ArialMT" style="normal" weight="normal"/>

i have generated the arialn.xml in this way:
java -cp fop.jar;avalon-framework.jar;commons-logging.jar;commons-io.jar
org.apache.fop.fonts.apps.TTFReader C:\windows\fonts\ARIALN.TTF
BUT....when i run my main class i get the error:
[ERROR] Failed to read a font metrics file: Invalid font metrics file:
null (spec must not be null)

so the PDF is produced but a default font is used.....I need to use the
Arial Narrow font form legal reason

can you help me?

barbara bruni (23521)
artemide tecnologie informatiche s.r.l.
Received on Friday, 13 February 2009 14:47:30 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:32 UTC