You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Phillip B Oldham <ph...@gmail.com> on 2012/06/14 13:39:46 UTC

"Unable to load font file" due to NullPointerException?

Hi all

Still having trouble loading custom fonts - this time with a different approach.

This time I'm running FOP instance with the following xml config:

<?xml version="1.0"?>
<fop version="1.0">
  <base>.</base>
  <source-resolution>72</source-resolution>
  <target-resolution>72</target-resolution>
  <default-page-settings height="297mm" width="210mm"/>
  <renderers>
    <renderer mime="application/pdf">
      <fonts>
        <directory recursive="true">fonts</directory>
      </fonts>
    </renderer>
  </renderers>
</fop>

When I start my app which uses FOP, the log displays the following error:

WARNING: Unable to load font file:
file:/Users/me/Projects/myproject/fonts/League_Gothic.ttf. Reason:
java.lang.NullPointerException

The path to the font is correct, the font exists and FontBook (I'm on
a mac) can read the font without issue (it's an open-source/free
font).

Any ideas what the error might be this time?

-- 
Phillip B Oldham
phillip.oldham@gmail.com
+44 (0) 7525 01 09 01

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: "Unable to load font file" due to NullPointerException?

Posted by Peter Hancock <pe...@gmail.com>.
Hi Phillip,

Could you provide instructions to locate the font and provide an .fo
that demonstrates the issue, please.  Can you also tell us what
version of FOP you are using.

Thanks,

Peter

On Thu, Jun 14, 2012 at 12:39 PM, Phillip B Oldham
<ph...@gmail.com> wrote:
> Hi all
>
> Still having trouble loading custom fonts - this time with a different approach.
>
> This time I'm running FOP instance with the following xml config:
>
> <?xml version="1.0"?>
> <fop version="1.0">
>  <base>.</base>
>  <source-resolution>72</source-resolution>
>  <target-resolution>72</target-resolution>
>  <default-page-settings height="297mm" width="210mm"/>
>  <renderers>
>    <renderer mime="application/pdf">
>      <fonts>
>        <directory recursive="true">fonts</directory>
>      </fonts>
>    </renderer>
>  </renderers>
> </fop>
>
> When I start my app which uses FOP, the log displays the following error:
>
> WARNING: Unable to load font file:
> file:/Users/me/Projects/myproject/fonts/League_Gothic.ttf. Reason:
> java.lang.NullPointerException
>
> The path to the font is correct, the font exists and FontBook (I'm on
> a mac) can read the font without issue (it's an open-source/free
> font).
>
> Any ideas what the error might be this time?
>
> --
> Phillip B Oldham
> phillip.oldham@gmail.com
> +44 (0) 7525 01 09 01
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org