xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Neumann <a.neum...@carto.net>
Subject Re: SVG and newline
Date Sun, 02 Nov 2008 18:49:56 GMT
Hi Lars,

\n is ignored in SVG.

In SVG 1.1 you can use <tspan dy="1.2em"/> for this purpose.

Here is an example:

<text x="10" y="50">Line 1
<tspan x="10" dy="1.2em">Line 2</tspan>
<tspan x="10" dy="1.2em">Line 3</tspan>
<tspan x="10" dy="1.2em">Line 4</tspan>

alternatively you can use <textArea/> for this purpose (from SVG 1.2):

<textArea x="10" y="50" width="200"  height="300">
Line 1<tbreak/>
Line 2<tbreak/>
Line 3<tbreak/>

or let the browser automatically break lines when the width of the 
textarea is fully used up.

I think Batik doesn't yet support the <textArea/> element, but 
implemented an earlier, more powerful version of text flowing in 
arbitrary shapes. <textArea/> is already supported in Opera >9.5x


Lars Eirik Rønning wrote:
> Hi.
> I need to add newline to my svg.
> all text will be dynamically generated.
> I have tried to add a textnode which only contains "" as well as 
> another one with "\n".
> Any easy fix for this?
> Thanks.

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

View raw message