Are tspans always necessary?

Discuss SVG code, accessible via the XML Editor.
EricWarnke
Posts: 8
Joined: Fri Mar 25, 2011 5:23 pm

Are tspans always necessary?

Postby EricWarnke » Sat Mar 26, 2011 1:49 am

Inkscape creates tspan elements inside each text element by default. Perhaps this could be cleaned up? I'm noticing that much of my XML has repetitive tspan elements that mirror their parent text element. Are these really necessary?

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: Are tspans always necessary?

Postby Simarilius » Sat Mar 26, 2011 3:17 am

No, their not, as long as you dont want to vary formatting/positioning within the text. tspans let you apply attributes to chunks of the text independently.
if you want you can take the tspan elements out and the text should still render, just all with the properties of the parent text element. (thats my understanding of it anyway)

EricWarnke
Posts: 8
Joined: Fri Mar 25, 2011 5:23 pm

Re: Are tspans always necessary?

Postby EricWarnke » Sat Mar 26, 2011 5:37 am

This should probably be how Inkscape acts by default, only putting in tspans if attributes are applied to chunks of the text.

Simarilius
Posts: 626
Joined: Wed Jun 06, 2007 2:37 am

Re: Are tspans always necessary?

Postby Simarilius » Sat Mar 26, 2011 8:55 am

It gets a lot more complicated tho then as you have to work out if theres a tspan or not etc, if you always put in at least 1 its consistant.

EricWarnke
Posts: 8
Joined: Fri Mar 25, 2011 5:23 pm

Re: Are tspans always necessary?

Postby EricWarnke » Sat Mar 26, 2011 9:53 am

Wouldn't it be worth saving the space in the filesize? I can't imagine it'd be that difficult to detect whether the text element has a tspan inside...


Return to “SVG / XML Code”