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 Lo...@log-net.com on 2006/02/16 18:12:55 UTC

Dynamic Configuration migration of 'strokeSVGText' and 'fonts'

I am in the process of upgrading from FOP 0.20.3 to 0.91.  My 
implementation uses both a config file and some programmatically loaded 
options, but I do not see how to accomplish this in the new version of 
FOP.  I am a little lost on how the Avalon configuration maps to the FOP 
user agent's config settings.  My older code below shows how I used to set 
the SVG stroke and add a font.  Can this still be done programmatically 
and are the setting "keys" still applicable?


Configuration.put("strokeSVGText", Boolean.TRUE);
//is this <strokeText value="false"/> in the image/svg+xml renderer?

//config fonts
Vector allFonts = new Vector();
Vector allTrips = new Vector();
                        //      name    weight  style
allTrips.add(new FontTriplet("MS Song","normal","normal"));
allTrips.add(new FontTriplet("MS Song","bold","normal"));
allTrips.add(new FontTriplet("MS Song","normal","italic"));
allTrips.add(new FontTriplet("MS Song","bold","italic"));
FontInfo fontInfo = new FontInfo("MS 
SONG",fileURLProto+"/fonts/mssong.xml",true,allTrips,"/fonts/mssong.ttf");
allFonts.add(fontInfo);
Configuration.put("fonts", allFonts);

Configuration.dumpConfiguration();


I see a reference to the userconfig.xml file on 
"http://xmlgraphics.apache.org/fop/0.91/fonts.html" but I do not see that 
file in the distribution.  I previously used this file to set some 
application-level defaults, but I override in my code.


Thanks,
Lou

Re: Dynamic Configuration migration of 'strokeSVGText' and 'fonts'

Posted by Vincent Hennebert <vi...@enseeiht.fr>.
Andreas L Delmelle a écrit :
>> Configuration.put("strokeSVGText", Boolean.TRUE);
>> //is this <strokeText value="false"/> in the image/svg+xml renderer?
> 
> 
> I don't think so... This would be an option for rendering to SVG (not  
> rendering of embedded or externally referenced SVG to PDF).
> 
> The good news --at least IIRC-- is that the option you need is now  
> handled automatically. If nothing hinders rendering a portion of SVG  
> text as PDF text instead of strokes, then the former is preferred.  
> Strokes are only used when the SVG text has properties that make it  too 
> difficult or outright impossible to render it directly as PDF text.
> [I'm not 100% sure here, maybe someone can confirm? This is the  
> impression I gathered from a discussion on fop-dev between Thomas  
> Deweese (Batik) and Jeremias a while ago... Bugzilla some-number-I'm- 
> too-lazy-to-look-for-right-now ;-)]

I confirm that that's the case. Although, I think, there are still some
little improvements to do (in some cases text is rendered as strokes
whereas it is possible to render it as PDF text).

Actually the strokeSVGText option doesn't even exist anymore in Fop
0.91, because it is no longer useful. Text will simply be rendered as
text whenever possible.


Vincent

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


Re: Dynamic Configuration migration of 'strokeSVGText' and 'fonts'

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Feb 16, 2006, at 21:17, Andreas L Delmelle wrote:

>>
>> //config fonts
>> Vector allFonts = new Vector();
>> Vector allTrips = new Vector();
> <snip />
>
> Should also work roughly the same way as for 0.20.X.
> One very important difference is that 0.91 still can't handle  
> relative font URLs, but you don't seem to be needing these (?)

... and as a heads-up: while browsing our website, I found that the  
changes page [*] indicates this will be fixed in the next release  
(current svn-trunk).

Just thought I'd let you know...

Cheers,

Andreas


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


Re: Dynamic Configuration migration of 'strokeSVGText' and 'fonts'

Posted by Andreas L Delmelle <a_...@pandora.be>.
On Feb 16, 2006, at 18:12, Louis.Masters@log-net.com wrote:

Hi Lou,

> I am in the process of upgrading from FOP 0.20.3 to 0.91.  My  
> implementation uses both a config file and some programmatically  
> loaded options, but I do not see how to accomplish this in the new  
> version of FOP.  I am a little lost on how the Avalon configuration  
> maps to the FOP user agent's config settings.  My older code below  
> shows how I used to set the SVG stroke and add a font.  Can this  
> still be done programmatically and are the setting "keys" still  
> applicable?

Some details have changed, but roughly: yes, it can still be done.

> Configuration.put("strokeSVGText", Boolean.TRUE);
> //is this <strokeText value="false"/> in the image/svg+xml renderer?

I don't think so... This would be an option for rendering to SVG (not  
rendering of embedded or externally referenced SVG to PDF).

The good news --at least IIRC-- is that the option you need is now  
handled automatically. If nothing hinders rendering a portion of SVG  
text as PDF text instead of strokes, then the former is preferred.  
Strokes are only used when the SVG text has properties that make it  
too difficult or outright impossible to render it directly as PDF text.
[I'm not 100% sure here, maybe someone can confirm? This is the  
impression I gathered from a discussion on fop-dev between Thomas  
Deweese (Batik) and Jeremias a while ago... Bugzilla some-number-I'm- 
too-lazy-to-look-for-right-now ;-)]

>
> //config fonts
> Vector allFonts = new Vector();
> Vector allTrips = new Vector();
<snip />

Should also work roughly the same way as for 0.20.X.
One very important difference is that 0.91 still can't handle  
relative font URLs, but you don't seem to be needing these (?) The  
custom fonts are now also set per renderer, so they need to be added  
as descendant nodes of the renderer configuration.

Very, very roughly, it should look something like this:
http://xmlgraphics.apache.org/fop/0.91/embedding.html#config-external

Except that, for you, before the call to userAgent.setUserConfig(),  
you would need to add the extra config options to the Configuration  
as created from the xml file. Before initializing the Fop instance  
with the userAgent some configuration options can still be altered  
directly on the userAgent --as described a little higher up on that  
same page.

> I see a reference to the userconfig.xml file on "http:// 
> xmlgraphics.apache.org/fop/0.91/fonts.html" but I do not see that  
> file in the distribution.  I previously used this file to set some  
> application-level defaults, but I override in my code.

The example configuration is the file: conf/fop.xconf


HTH!

Andreas

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