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 Dan Schmierer <da...@smsolutions.co.nz> on 2002/08/28 04:47:13 UTC

Text output from XSL:FO to SVG conversion

Hi,

I plan to use FOP primarily for converting xsl:fo to SVG. I am 
wondering how flexible the structure of the SVG output is, with 
respect to text. 

The current output I obtain from a xsl:fo to SVG conversion 
describes text with a <text> element per word (which is a little 
bloaty). Alternatively, paragraphs could be described in a more 
granular (and arguably more logical) manner involving a <text> or 
<tspan> element per paragraph, an outer <tspan> element per line 
to control granularity and series of <tspan> elements contained 
within that line <tspan>, that each describe a series of words of the 
same style within that line.

So, does anyone else have any thoughts on this matter? Is the 
output structure set in stone? It's not a big deal (hey, I'm just 
happy it works), but I'm interested how other people feel and if 
there are any workarounsdbefore I head off and rush into the SVG 
section of the source code.

Cheers



Re: Text output from XSL:FO to SVG conversion

Posted by Keiron Liddle <ke...@aftexsw.com>.
Hi Dan,


On Wed, 2002-08-28 at 04:47, Dan Schmierer wrote:
> Hi,
> 
> I plan to use FOP primarily for converting xsl:fo to SVG. I am 
> wondering how flexible the structure of the SVG output is, with 
> respect to text. 

At the moment there is only one possible output. Essentially it follows
the way that text is drawn in other renderers especially the PDF
renderer.
This renderer was written quickly mainly as an example and to get some
images from fo pages. If you have only 10 pages or so the viewer may
become slow and have memory problems.

The new renderer interface in development will make it possible to
output better svg that could do some of the things you are looking for.

> The current output I obtain from a xsl:fo to SVG conversion 
> describes text with a <text> element per word (which is a little 
> bloaty). Alternatively, paragraphs could be described in a more 
> granular (and arguably more logical) manner involving a <text> or 
> <tspan> element per paragraph, an outer <tspan> element per line 
> to control granularity and series of <tspan> elements contained 
> within that line <tspan>, that each describe a series of words of the 
> same style within that line.
> 
> So, does anyone else have any thoughts on this matter? Is the 
> output structure set in stone? It's not a big deal (hey, I'm just 
> happy it works), but I'm interested how other people feel and if 
> there are any workarounsdbefore I head off and rush into the SVG 
> section of the source code.

You may be able to do some improvements with the old code but it would
be a lot easier to work on the redesigned svg renderer.

Eventually the output structure could be configurable incorporating
ideas such as:
- one svg file per page or page sequence
- internal/external images
- the way text is placed

I agree it would be better if text could be selected at least on the
line level.


Regards,
Keiron.