You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Lars Eirik Rønning <la...@gmail.com> on 2008/11/02 16:41:51 UTC
SVG and newline
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.
Re: SVG and newline
Posted by th...@kodak.com.
Hi Lars,
"Lars Eirik Rønning" <la...@gmail.com> wrote on 11/02/2008 02:54:41
PM:
> Thats pretty much what i already do now;)
So is your problem solved?
If you simply want to force a line break you should
use the <flowLine> element inside Batik's flow support.
> On Sun, Nov 2, 2008 at 7:49 PM, Andreas Neumann <a....@carto.net>
wrote:
> 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>
> </text>
>
> 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/>
> Line4
> </textArea>
>
> 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
>
> Andreas
>
>
> 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
Re: SVG and newline
Posted by Lars Eirik Rønning <la...@gmail.com>.
thanks.Thats pretty much what i already do now;)
On Sun, Nov 2, 2008 at 7:49 PM, Andreas Neumann <a....@carto.net> wrote:
> 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>
> </text>
>
> 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/>
> Line4
> </textArea>
>
> 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
>
> Andreas
>
>
> 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
>
>
Re: SVG and newline
Posted by Andreas Neumann <a....@carto.net>.
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>
</text>
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/>
Line4
</textArea>
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
Andreas
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