OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: RE: [docbook-apps] FOP 0.93: Cannot load fonts/NullPointerException

Perhaps it's something to do with a conflict between FOP and JRE 1.5. After using absolute references to the fonts, I no longer get the error. However, I get the following NullPointerException:

SEVERE: Exception
	at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:168)
	at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:115)
	at org.apache.fop.cli.Main.startFOP(Main.java:160)
	at org.apache.fop.cli.Main.main(Main.java:191)

I've attached the config file I'm using and the resulting FO file I'm trying to convert to PDF.

Jeff Powanda
Vocera Communications
Senior Technical Writer
-----Original Message-----
From: Vincent Hennebert [mailto:vincent.hennebert@anyware-tech.com] 
Sent: Monday, March 12, 2007 1:23 AM
To: docbook-apps@lists.oasis-open.org
Subject: Re: [docbook-apps] FOP 0.93: Cannot load fonts/NullPointerException

[Re-sending to the list...]

Jeff Powanda a écrit :
> Yes, I've tried using absolute URLs for both the <font-base> element and
> the metrics-url attribute on the <font> element. Both still result in
> the null pointer exception when I run FOP.

Relative URLs should work, both for <base> and <font-base>. Are you sure
of your metrics filename? Do you also have the problem for other metrics
Can you post your config file and, if possible, the FO file resulting
from the XSLT transformation (or a stripped-down version showing the


> -----Original Message-----
> From: Mauritz Jeanson [mailto:mj@johanneberg.com] 
> Sent: Saturday, March 10, 2007 2:42 AM
> To: Jeff Powanda; docbook-apps@lists.oasis-open.org
> Subject: RE: [docbook-apps] FOP 0.93: Cannot load
> fonts/NullPointerException
>> -----Original Message-----
>> From: Jeff Powanda 
>> I'm using the DocBook 1.72 XSL stylesheets with FOP 0.93. I 
>> followed the Apache FOP instructions for regenerating font 
>> metrics files, and I updated the FOP configuration file to 
>> the new format. When I run FOP, I get the following exception.
>> SEVERE: Exception
>> java.lang.RuntimeException: Cannot load font: failed to 
>> create Source from metrics file SY______.xml
>> It didn't seem to be loading any of the fonts. The 
>> <font-base> in the configuration file was correct, so I don't 
>> know why it couldn't load the files. I decided to update the 
>> configuration file to use relative URLs based on the <base>. 
>> When I ran FOP again, I got a NullPointerException:
> Have you tried to use absolute URIs for either the <font-base> element
> or
> the metrics-url attribute on the <font> elements? These methods work for
> me.
> For example,
>  <font-base>file:///c:/Java/fop-0.93/conf/</font-base>
> or 
>  <font metrics-url="file:///C:/Java/fop-0.93/conf/gara.xml"
> kerning="yes" 
> 	 embed-url="file:///C:/WINDOWS/Fonts/GARA.TTF">
> 	  <font-triplet name="Garamond" style="normal" weight="normal"/>
>  </font>
> /MJ
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org


<?xml version="1.0"?>
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at


  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  See the License for the specific language governing permissions and
  limitations under the License.
<!-- $Id: fop.xconf 447325 2006-09-18 10:55:33 +0200 (Mon, 18 Sep 2006) jeremias $ -->


This is an example configuration file for FOP.
This file contains the same settings as the default values
and will have no effect if used unchanged.

Relative config url's will be resolved relative to
the location of this file.


<!-- NOTE: This is the version of the configuration -->
<fop version="1.0">

  <!-- Base URL for resolving relative URLs -->

  <!-- Font Base URL for resolving relative font URLs -->

  <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
  <!-- Target resolution in dpi (dots/pixels per inch) for specifying the target resolution for generated bitmaps, default: 72dpi -->
  <!-- Default page-height and page-width, in case
       value is specified as auto -->
  <default-page-settings height="11in" width="8.26in"/>
  <!-- Information for specific renderers -->
  <!-- Uses renderer mime type for renderers -->
    <renderer mime="application/pdf">
        <!-- provides compression using zlib flate (default is on) -->
        <!-- encodes binary data into printable ascii characters (default off)
             This provides about a 4:5 expansion of data size -->
        <!-- <value>ascii-85</value> -->
        <!-- encodes binary data with hex representation (default off)
             This filter is not recommended as it doubles the data size -->
        <!-- <value>ascii-hex</value> -->

        <!-- embedded fonts -->
        This information must exactly match the font specified
        in the fo file. Otherwise it will use a default font.

        For example,
        <fo:inline font-family="Arial" font-weight="bold" font-style="normal">
            Arial-normal-normal font
        for the font triplet specified by:
        <font-triplet name="Arial" style="normal" weight="bold"/>

        If you do not want to embed the font in the pdf document
        then do not include the "embed-url" attribute.
        The font will be needed where the document is viewed
        for it to be displayed properly.

        possible styles: normal | italic | oblique | backslant
        possible weights: normal | bold | 100 | 200 | 300 | 400
                          | 500 | 600 | 700 | 800 | 900
        (normal = 400, bold = 700)

        <font  metrics-url="FTB_____.xml" kerning="yes" 
          <font-triplet name="Frutiger-Bold" style="normal" weight="bold"/>
          <font-triplet name="Frutiger 45 Light" style="normal" weight="bold"/>
        <font  metrics-url="FTBC____.xml" kerning="yes" 
          <font-triplet name="Frutiger-BoldCn" style="normal" weight="bold"/>
          <font-triplet name="Frutiger 47LightCn" style="normal" weight="bold"/> 

        <font  metrics-url="FTBI____.xml" kerning="yes" 
          <font-triplet name="Frutiger-BoldItalic" style="italic" weight="bold"/>
          <font-triplet name="Frutiger 45 Light" style="italic" weight="bold"/>
        <font  metrics-url="FTBL____.xml" kerning="yes" 
          <font-triplet name="Frutiger-Black" style="normal" weight="normal"/>
          <font-triplet name="Frutiger 55 Roman" style="normal" weight="normal"/>
        <font  metrics-url="FTBLC___.xml" kerning="yes" 
          <font-triplet name="Frutiger-BlackCn" style="normal" weight="normal"/>
          <font-triplet name="Frutiger 57Cn" style="normal" weight="normal"/>
        <font  metrics-url="FTBLI___.xml" kerning="yes" 
          <font-triplet name="Frutiger-BlackItalic" style="italic" weight="normal"/>
          <font-triplet name="Frutiger 55 Roman" style="italic" weight="normal"/>
        <font  metrics-url="FTC_____.xml" kerning="yes" 
          <font-triplet name="Frutiger-Cn" style="normal" weight="bold"/>
          <font-triplet name="Frutiger 57Cn" style="normal" weight="bold"/> 

        <font  metrics-url="FTEBC___.xml" kerning="yes" 
          <font-triplet name="Frutiger-ExtraBlackCn" style="normal" weight="normal"/>
          <font-triplet name="Frutiger 87ExtraBlackCn" style="normal" weight="normal"/> 
        <font  metrics-url="FTI_____.xml" kerning="yes" 
          <font-triplet name="Frutiger-Italic" style="italic" weight="normal"/>
          <font-triplet name="Frutiger 55 Roman" style="italic" weight="normal"/> 
         <font  metrics-url="FTL_____.xml" kerning="yes" 
          <font-triplet name="Frutiger-Light" style="normal" weight="normal"/>
          <font-triplet name="Frutiger 45 Light" style="normal" weight="normal"/> 
        <font  metrics-url="FTLC____.xml" kerning="yes" 
          <font-triplet name="Frutiger-LightCn" style="normal" weight="normal"/>
          <font-triplet name="Frutiger 47LightCn" style="normal" weight="normal"/> 
        <font  metrics-url="FTLI____.xml" kerning="yes" 
          <font-triplet name="Frutiger-LightItalic" style="italic" weight="normal"/>
          <font-triplet name="Frutiger 45 Light" style="italic" weight="normal"/> 
        <font  metrics-url="FTR_____.xml" kerning="yes" 
          <font-triplet name="Frutiger-Roman" style="normal" weight="normal"/>
          <font-triplet name="Frutiger 55 Roman" style="normal" weight="normal"/> 
        <font  metrics-url="FTUBL___.xml" kerning="yes" 
          <font-triplet name="Frutiger-UltraBlack" style="normal" weight="normal"/>
          <font-triplet name="Frutiger 95 UltraBlack" style="normal" weight="normal"/> 

        <font  metrics-url="SY______.xml" kerning="yes" 
          <font-triplet name="Symbol" style="normal" weight="normal"/>
          <font-triplet name="Symbol" style="normal" weight="bold"/>
          <font-triplet name="Symbol" style="italic" weight="normal"/>

        <font  metrics-url="ZD______.xml" kerning="yes"
          <font-triplet name="ZapfDingbats" style="normal" weight="normal"/>
          <font-triplet name="ZapfDingbats" style="normal" weight="bold"/>
          <font-triplet name="ZapfDingbats" style="italic" weight="normal"/>

        <font metrics-url="arial.xml" kerning="yes" embed-url="arial.ttf">
          <font-triplet name="Arial" style="normal" weight="normal"/>
          <font-triplet name="ArialMT" style="normal" weight="normal"/>
        <font metrics-url="arialb.xml" kerning="yes" embed-url="arialb.ttf">
          <font-triplet name="Arial" style="normal" weight="bold"/>
          <font-triplet name="ArialMT" style="normal" weight="bold"/>

      <!-- This option lets you specify additional options on an XML handler -->
      <!--xml-handler namespace="http://www.w3.org/2000/svg";>


    <renderer mime="application/postscript">
      <!-- This option forces the PS renderer to rotate landscape pages -->
      <!-- This option lets you specify additional options on an XML handler -->
      <!--xml-handler namespace="http://www.w3.org/2000/svg";>

    <renderer mime="application/vnd.hp-PCL">

    <!-- MIF does not have a renderer
    <renderer mime="application/vnd.mif">

    <renderer mime="image/svg+xml">
      <format type="paginated"/>
      <link value="true"/>
      <strokeText value="false"/>

    <renderer mime="application/awt">

    <renderer mime="image/png">

    <renderer mime="image/tiff">
      <!--compression>CCITT T.6</compression-->

    <renderer mime="text/xml">

    <!-- RTF does not have a renderer
    <renderer mime="text/rtf">

    <renderer mime="text/plain">
      <pageSize columns="80"/>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]