forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: FOPNGSerializer and user-configurable fonts - fonts not found
Date Tue, 09 Sep 2008 10:23:29 GMT
On 09.09.2008 11:02:52 Sjur Moshagen wrote:
> Hello all,
> 
> The work I've done lately isn't completely successful, but I'm not  
> able to find the source of the problem. Success story first:
> 
> It is now possible to specify the font family being used (hm, I have a  
> feeling I have said this a couple of times...). This was tested by  
> just switching around the generic families serif, sans-serif and  
> monospace, and it works fine.
> 
> Conclusion: the changes I made are working as intended.
> 
> BUT: now I wanted to use this to specify the correct font family for a  
> site of ours, but the fonts are not found. Instead I get error  
> messages like:
> 
> WARN - Font 'Lucida Grande,normal,700' not found. Substituting with  
> 'any,normal,700'.
> WARN - Font 'Junicode,italic,400' not found. Substituting with  
> 'any,italic,400'.
> WARN - Font 'Junicode,normal,400' not found. Substituting with  
> 'any,normal,400'.
> 
> 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.

> The font configuration file is correctly found (otherwise the error  
> message would have been completely different), and I have updated the  
> configuration file to what is described on the FOP pages[1] (I  
> actually copied the file from the FOP svn repository, as described on  
> [2], the structure of the file has changed quite a bit since our  
> previous FOP version), still no luck.
> 
> I have tried with system-installed fonst (on MacOS X), and fonts  
> available only to Forrest/FOP (in the $PROJECT_HOME/src/documentation/ 
> resources/fonts/ folder). Nothing works.
> 
> If I specify one of the base-14 fonts (Times, Helvetica, Courier,  
> symbols and dingbats), I get no error messages, but characters outside  
> ANSI 1252 are displayed as #, even though the fonts on my system  
> actually do contain the requested glyphs.
> 
> Somehow this seems to be related to the FOP 0.94 upgrade a while ago,  
> as this used to work for me and my colleagues.

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.

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.

HTH

> Any help would be greatly appreciated.
> 
> Best regards,
> Sjur
> 
> [1] http://xmlgraphics.apache.org/fop/0.94/fonts.html
> [2] http://xmlgraphics.apache.org/fop/0.94/configuration.html




Jeremias Maerki


Mime
View raw message