problemsin register a font

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 =
"C:\\ws\\pdf\\WebContent\\WEB-INF\\conf\\userconfig.xml";
File userConfigFile = new File(userConfig);
Options options = new Options();
options.loadUserconfiguration(userConfigFile);
        
 
Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_WARN);
driver.setLogger(logger);
 
MessageHandler.setScreenLogger(logger);        
driver.setRenderer(Driver.RENDER_PDF);
 
OutputStream out = new java.io.FileOutputStream(pdf);
driver.setOutputStream(out);
 
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
 
<configuration>
  <entry>
    <key>fontBaseDir</key>
    <value>C:\windows\fonts</value>
  </entry>
<fonts>  
    <font metrics-url="file:///C:/ws/pdf/WebContent/font/arialn.xml
<file:///C:/ws/pdf/WebContent/font/arialn.xml> " kerning="yes"
embed-url="file:///C:\windows\fonts\ARIALN.TTF
<file:///C:\windows\fonts\ARIALN.TTF> ">
      <font-triplet name="Arial" style="normal" weight="normal"/>
      <font-triplet name="ArialMT" style="normal" weight="normal"/>
    </font>
</fonts>  
</configuration> 

 
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
C:\ws\pdf\WebContent\font\arialn.xml
 
 
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?

thanks
barbara
 
 
barbara bruni (23521)
-------------------------------
artemide tecnologie informatiche s.r.l.
 

Received on Friday, 13 February 2009 14:47:30 UTC