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 haad <ha...@gmail.com> on 2007/03/20 17:17:42 UTC

Cannot loadfont error

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I'm trying to run fop-0.93 and I have problem with font embeding.
This is java trace when I run fop with -d parameter.

Mar 20, 2007 5:01:54 PM org.apache.fop.apps.FopFactory getBaseURLfromConfig
INFO: font-base set to: file:///home/haad/opt/fop-0.93/fonts/
Mar 20, 2007 5:01:54 PM org.apache.fop.apps.FopFactory initUserConfig
INFO: Source resolution set to: 72.0dpi (px2mm=0.35277778)
Mar 20, 2007 5:01:54 PM org.apache.fop.apps.FopFactory initUserConfig
INFO: Default page-height set to: 11in
Mar 20, 2007 5:01:54 PM org.apache.fop.apps.FopFactory initUserConfig
INFO: Default page-width set to: 8.26in
Mar 20, 2007 5:01:54 PM org.apache.fop.apps.FopFactory getBaseURLfromConfig
INFO: base set to: file:///home/haad/opt/fop-0.93/conf
Mar 20, 2007 5:01:54 PM org.apache.fop.apps.FOUserAgent configure
INFO: Target resolution set to: 72.0dpi (px2mm=0.35277778)
Mar 20, 2007 5:01:55 PM org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.lang.RuntimeException: Cannot load font. No font URIs available.
        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)


java.lang.RuntimeException: Cannot load font. No font URIs available.
        at org.apache.fop.fonts.LazyFont.load(LazyFont.java:113)
        at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:198)
        at org.apache.fop.fonts.Font.getAscender(Font.java:67)
        at
org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:84)
        at
org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:117)
        at
org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:76)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextKnuthElements(PageSequenceLayoutManager.java:272)
        at
org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:554)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager$PageBreaker.getNextBlockList(PageSequenceLayoutManager.java:264)
        at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:301)
        at
org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:263)
        at
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:157)
        at
org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:385)
        at
org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:148)
        at
org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:378)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:194)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.endElement(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at
org.apache.xalan.transformer.TransformerIdentityImpl.transform(Unknown Source)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:165)
        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)


my userconfig.xml file looks like this:

<?xml version="1.0"?>
<fop version="1.0">
  <base>file:///home/haad/opt/fop-0.93/conf</base>
  <font-base>file:///home/haad/opt/fop-0.93/fonts/</font-base>

[snip]

<fonts>
 <font metrics-file="conf/timesbd.xml" kerning="yes" embed-file="timesbd.ttf">
    <font-triplet name="TimesNewRoman" style="normal" weight="bold"/>
    <font-triplet name="serif" style="normal" weight="bold"/>
 </font>

 <font metrics-file="conf/arial.xml" kerning="yes" embed-file="arial.ttf">
    <font-triplet name="Arial" style="normal" weight="normal"/>
    <font-triplet name="sans-serif" style="normal" weight="normal"/>
 </font>
 <font metrics-file="conf/ariali.xml" kerning="yes" embed-file="ariali.ttf">
    <font-triplet name="Arial" style="italic" weight="normal"/>
    <font-triplet name="sans-serif" style="italic" weight="normal"/>
 </font>
 <font metrics-file="conf/arialbi.xml" kerning="yes" embed-file="arialbi.ttf">
    <font-triplet name="Arial" style="italic" weight="bold"/>
    <font-triplet name="sans-serif" style="italic" weight="bold"/>
 </font>

</fonts>

I have tried substitute relative URIsembed-file="ariali.ttf" with
"file:///home/haad/opt/fop-0.93/conf/times.xml" but it doesn't work ,too.

Can you help me? fo-0.20.5 works fine for me.

Regards

P.S. please CC to me I'm not subscribed to this mailinglist.
- ---------------------------------------------------------------
Adam Hamsik
ICQ 249727910
jabber haad@jabber.org
- ---------------------------------------------------------------
There are 10 kinds of people in the world. Those who understand
binary numbers, and those who don't.
				
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGAAkm9Wt2FT7y228RAshfAKCYPWOr3fj+D56A4d6e8oKj3SCggQCglZEa
zVLUXENDM1sqzpGOoFEvA+k=
=hX6p
-----END PGP SIGNATURE-----

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


Re: Cannot loadfont error

Posted by haad <ha...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeremias Maerki wrote:
> On 20.03.2007 17:17:42 haad wrote:
>> I'm trying to run fop-0.93 and I have problem with font embeding.
>> This is java trace when I run fop with -d parameter.
>>
> 
> <snip/>
>> java.lang.RuntimeException: Cannot load font. No font URIs available.
> <snip/>
>> my userconfig.xml file looks like this:
>>
>> <?xml version="1.0"?>
>> <fop version="1.0">
>>   <base>file:///home/haad/opt/fop-0.93/conf</base>
>>   <font-base>file:///home/haad/opt/fop-0.93/fonts/</font-base>
>>
>> [snip]
>>
>> <fonts>
>>  <font metrics-file="conf/timesbd.xml" kerning="yes" embed-file="timesbd.ttf">
> 
> Should be:
> <font metrics-url="conf/timesbd.xml" kerning="yes" embed-url="timesbd.ttf">
> as explained in http://xmlgraphics.apache.org/fop/0.93/configuration.html#renderers
> 
thx now it works like a charm :). Sorry for noise I have read this link almost
10 times.

[snip]

I think that fop documentation should mention that metrics file URL is relative
to font-base dir.



Regards
- ---------------------------------------------------------------
Adam Hamsik
ICQ 249727910
jabber haad@jabber.org
- ---------------------------------------------------------------
There are 10 kinds of people in the world. Those who understand
binary numbers, and those who don't.
				
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGASCX9Wt2FT7y228RAgLfAKCDKcBNGdPDvu/O5yBumcvvlO6fUwCfRkcL
Ma+yJkXw9WjVxwRCFciQTjM=
=zHV+
-----END PGP SIGNATURE-----

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


Re: Cannot loadfont error

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 20.03.2007 17:17:42 haad wrote:
> I'm trying to run fop-0.93 and I have problem with font embeding.
> This is java trace when I run fop with -d parameter.
> 

<snip/>
> java.lang.RuntimeException: Cannot load font. No font URIs available.
<snip/>
> 
> my userconfig.xml file looks like this:
> 
> <?xml version="1.0"?>
> <fop version="1.0">
>   <base>file:///home/haad/opt/fop-0.93/conf</base>
>   <font-base>file:///home/haad/opt/fop-0.93/fonts/</font-base>
> 
> [snip]
> 
> <fonts>
>  <font metrics-file="conf/timesbd.xml" kerning="yes" embed-file="timesbd.ttf">

Should be:
<font metrics-url="conf/timesbd.xml" kerning="yes" embed-url="timesbd.ttf">
as explained in http://xmlgraphics.apache.org/fop/0.93/configuration.html#renderers

The config file format has changed since 0.20.5:
http://xmlgraphics.apache.org/fop/0.93/upgrading.html

Good thing that kind of configuration will soon be a thing of the past.

>     <font-triplet name="TimesNewRoman" style="normal" weight="bold"/>
>     <font-triplet name="serif" style="normal" weight="bold"/>
>  </font>
> 
>  <font metrics-file="conf/arial.xml" kerning="yes" embed-file="arial.ttf">
>     <font-triplet name="Arial" style="normal" weight="normal"/>
>     <font-triplet name="sans-serif" style="normal" weight="normal"/>
>  </font>
>  <font metrics-file="conf/ariali.xml" kerning="yes" embed-file="ariali.ttf">
>     <font-triplet name="Arial" style="italic" weight="normal"/>
>     <font-triplet name="sans-serif" style="italic" weight="normal"/>
>  </font>
>  <font metrics-file="conf/arialbi.xml" kerning="yes" embed-file="arialbi.ttf">
>     <font-triplet name="Arial" style="italic" weight="bold"/>
>     <font-triplet name="sans-serif" style="italic" weight="bold"/>
>  </font>
> 
> </fonts>
> 
> I have tried substitute relative URIsembed-file="ariali.ttf" with
> "file:///home/haad/opt/fop-0.93/conf/times.xml" but it doesn't work ,too.
> 
> Can you help me? fo-0.20.5 works fine for me.
> 
> Regards
> 
> P.S. please CC to me I'm not subscribed to this mailinglist.
> - ---------------------------------------------------------------
> Adam Hamsik
> ICQ 249727910
> jabber haad@jabber.org
> - ---------------------------------------------------------------
> There are 10 kinds of people in the world. Those who understand
> binary numbers, and those who don't.


Jeremias Maerki


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


Re: Cannot loadfont error

Posted by "J.Pietschmann" <j3...@yahoo.de>.
haad wrote:
> I'm trying to run fop-0.93 and I have problem with font embeding.
...
> SEVERE: Exception
> java.lang.RuntimeException: Cannot load font. No font URIs available.
...
> my userconfig.xml file looks like this:
...
>   <base>file:///home/haad/opt/fop-0.93/conf</base>
>   <font-base>file:///home/haad/opt/fop-0.93/fonts/</font-base>
...
>  <font metrics-file="conf/timesbd.xml" kerning="yes" embed-file="timesbd.ttf">

This would expect the metrics file as either
  file:///home/haad/opt/fop-0.93/conf/conf/timesbd.xml
or
  file:///home/haad/opt/fop-0.93/fonts/conf/timesbd.xml,
which is most likely not where the file really lives.

> I have tried substitute relative URIsembed-file="ariali.ttf" with
> "file:///home/haad/opt/fop-0.93/conf/times.xml" but it doesn't work ,too.

This isn't expected to work, because you can't substitute the actual
font file with the metrics file, even if the URL is correct.

J.Pietschmann




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