You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Vincent Hennebert <vi...@enseeiht.fr> on 2005/09/06 21:45:12 UTC

User config file currently discarded

Hi,

By trying to debug my FOrayFont adaptation I noticed that the user config file 
currently isn't taken into account by the Trunk.

The apps.FOUserAgent.getConfig() method is actually never called within the 
code, and (as a consequence I suppose) neither is the 
PDFRenderer.configure(Configuration) method, whose purpose is among other things 
to register fonts specified in the user config file.

Is there a particular reason for this situation? A simple fix would be to call 
configure within the AbstractRenderer.setUserAgent method, where we can get the 
user config file associated with the UserAgent given as parameter.
This is perhaps not the right place to do that? But if it's ok I can provide a 
patch.

Vincent

Re: User config file currently discarded

Posted by Vincent Hennebert <vi...@enseeiht.fr>.
Jeremias Maerki a écrit :
> Actually, everything is fine with the code. The renderer is already
> configured through the RendererFactory. I assume the problem is the
> changed format of the userconfig.xml file. I've attached a demo file.

Oh well. I didn't realize that the conf/fop.xconf file in the trunk was the new 
config file. I was expecting a file like the conf/userconfig.xml in the 0.20.5 
trunk. As the structure of the new file is quite different I confused it with 
the old config.xml, which had another purpose.

Sorry for the noise :-/
And thanks for the explanation, anyway.

Vincent

Re: User config file currently discarded

Posted by Jeremias Maerki <de...@greenmail.ch>.
Actually, everything is fine with the code. The renderer is already
configured through the RendererFactory. I assume the problem is the
changed format of the userconfig.xml file. I've attached a demo file.
Note that each renderer has its own font setup now, mostly because every
renderer may have slightly different config values. PS, for example,
although it supports the same font subsystem, doesn't support the same
filter list config. BTW, the filter setup in the demo file shows how to
set the normal stream filter so page streams are not compressed and can
easily be inspected in a text editor.

Note that if you construct the renderer yourself and supply it through
the FOUserAgent, you need to call the configure method yourself. This
can easily be done through Avalon's ContainerUtil helper:

    ContainerUtil.configure(renderer, cfg.getChild("pdf-renderer"));

This also handles cases in which the Renderer doesn't implement the
Avalon Configurable interface and thus does not support configuration
through this means.

HTH

On 06.09.2005 22:05:27 Jeremias Maerki wrote:
> No particular reason, no. It's just some missing integration work. I'm
> configuring my renderer instances directly so I haven't used the
> FOUserAgent for that. If it's ok for you I'll quickly look into it right
> now and see what I can do. Actually, I wouldn't want to call configure
> during setUserAgent(). I will probably do that in the RendererFactory to
> have a central place to do that.
> 
> On 06.09.2005 21:45:12 Vincent Hennebert wrote:
> > Hi,
> > 
> > By trying to debug my FOrayFont adaptation I noticed that the user config file 
> > currently isn't taken into account by the Trunk.
> > 
> > The apps.FOUserAgent.getConfig() method is actually never called within the 
> > code, and (as a consequence I suppose) neither is the 
> > PDFRenderer.configure(Configuration) method, whose purpose is among other things 
> > to register fonts specified in the user config file.
> > 
> > Is there a particular reason for this situation? A simple fix would be to call 
> > configure within the AbstractRenderer.setUserAgent method, where we can get the 
> > user config file associated with the UserAgent given as parameter.
> > This is perhaps not the right place to do that? But if it's ok I can provide a 
> > patch.
> > 
> > Vincent
> 
> 
> 
> Jeremias Maerki



Jeremias Maerki

Re: User config file currently discarded

Posted by Jeremias Maerki <de...@greenmail.ch>.
No particular reason, no. It's just some missing integration work. I'm
configuring my renderer instances directly so I haven't used the
FOUserAgent for that. If it's ok for you I'll quickly look into it right
now and see what I can do. Actually, I wouldn't want to call configure
during setUserAgent(). I will probably do that in the RendererFactory to
have a central place to do that.

On 06.09.2005 21:45:12 Vincent Hennebert wrote:
> Hi,
> 
> By trying to debug my FOrayFont adaptation I noticed that the user config file 
> currently isn't taken into account by the Trunk.
> 
> The apps.FOUserAgent.getConfig() method is actually never called within the 
> code, and (as a consequence I suppose) neither is the 
> PDFRenderer.configure(Configuration) method, whose purpose is among other things 
> to register fonts specified in the user config file.
> 
> Is there a particular reason for this situation? A simple fix would be to call 
> configure within the AbstractRenderer.setUserAgent method, where we can get the 
> user config file associated with the UserAgent given as parameter.
> This is perhaps not the right place to do that? But if it's ok I can provide a 
> patch.
> 
> Vincent



Jeremias Maerki