forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sjur Moshagen <sju...@mac.com>
Subject Re: FOPNGSerializer and user-configurable fonts - fonts not found
Date Tue, 09 Sep 2008 11:07:57 GMT
Den 9. sep. 2008 kl. 13.23 skrev Jeremias Maerki:

>> I admit that this is really a FOP question, and not really a Forrest
>> issue. Then on the other hand, FOP 0.94 (which we are using) and the
>> font-finding features have been around for some time now, and should
>> work, or problems should be known, and workarounds should be  
>> available
>> in e-mail list archives, wikis, FAQs etc. I have found nothing, which
>> makes me wonder whether there is a problem in the interaction between
>> Forrest and FOP.
>
> My first question would be: How does your configuration file look  
> like?
> A minimal FOP config file for font auto-detection would look like  
> this:
>
> <fop>
>  <renderers>
>    <renderer mime="application/pdf">
>      <fonts>
>        <auto-detect/>
>      </fonts>
>    </renderer>
>  </renderers>
> </fop>
>
> The most common problem is that the layout of the config file is  
> wrong.
> FOP isn't that good at detecting problem there.

I got this far on my own:)

The FOP config file I have at the moment looks like:

<fop version="1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/foschema/fop-configuration.xsd?view=co

">
   <base>.</base>
   <source-resolution>72</source-resolution>
   <target-resolution>72</target-resolution>
   <default-page-settings height="11in" width="8.26in"/>
   <renderers>
     <renderer mime="application/pdf">
       <filterList>
         <value>flate</value>
       </filterList>
       <fonts>
         <font metrics-url="DejaVuSans.ttf.xml"
               kerning="yes" embed-url="DejaVuSans.ttf">
           <font-triplet name="DejaVu Sans" style="normal"  
weight="normal"/>
           <font-triplet name="DejaVu Sans,Book" style="normal"  
weight="normal"/>
         </font>
         <font metrics-url="DejaVuSans-Bold.ttf.xml"
               kerning="yes" embed-url="DejaVuSans-Bold.ttf">
           <font-triplet name="DejaVu Sans" style="normal"  
weight="bold"/>
           <font-triplet name="DejaVu Sans,Bold" style="normal"  
weight="bold"/>
         </font>
         <font metrics-url="DejaVuSans-BoldOblique.ttf.xml"
               kerning="yes" embed-url="/Library/Fonts/DejaVuSans- 
BoldOblique.ttf">
           <font-triplet name="DejaVu Sans" style="italic"  
weight="bold"/>
           <font-triplet name="DejaVu Sans,BoldOblique" style="italic"  
weight="bold"/>
         </font>
         <font metrics-url="DejaVuSans-Oblique.ttf.xml"
               kerning="yes" embed-url="/Library/Fonts/DejaVuSans- 
Oblique.ttf">
           <font-triplet name="DejaVu Sans" style="italic"  
weight="normal"/>
           <font-triplet name="DejaVu Sans,Oblique" style="italic"  
weight="normal"/>
         </font>
         <auto-detect/>
       </fonts>
     </renderer>
     <!-- Some other renderers follow here -->
   </renderers>
</fop>

> I would strongly suggest to upgrade to FOP 0.95 soon. There have  
> been a
> large number of improvements in font handling and auto-detection after
> the 0.94 release. It also goes the remaining way to make XML font
> metrics files really obsolete. This is be a matter of replacing the  
> JAR
> file for FOP and XML Graphics Commons. I've done that locally. I can
> commit the changes if everyone's ok with it.

+1

> I've been able to create a PDF with FOP 0.95 and customized fonts but
> only if I hardcode the config file to this:
> <user-config>src/documentation/fop-config.xml</user-config>
>
> With the entity, I didn't manage. So maybe the above problem is not a
> wrong config file format but maybe the somewith with those entity  
> files.

The entity seems to work fine for me. If I change the config file ref  
to some non-existing file/path, I get back an error that the config  
file could not be found.

I would like to have a look at the entity thing as soon as FOP 0.95 is  
available. And some days a go, David Crossley posted an alternative  
solution[1] to the entity one. Hopefully we can make one of them work.

Best regards,
Sjur

[1] http://marc.info/?l=forrest-dev&m=122031724625959&w=2


Mime
View raw message