W3C home > Mailing lists > Public > www-svg@w3.org > November 2010

Animating the "rotate" attribute of a tspan

From: ddailey <ddailey@zoominternet.net>
Date: Sat, 13 Nov 2010 15:25:16 -0500
Message-ID: <0B655F29A7C544299B52D45019C6CC5F@disxgdg31szkx7>
To: "www-svg" <www-svg@w3.org>
Different browsers seem to have different ideas for where to put the rotated 
text inside a tspan.

See http://srufaculty.sru.edu/david.dailey/svg/newstuff/text6.svg (sorry 
about the claim that only IE/ASV handles dy="1em" -- that was true in 2007! 
and I haven't had a chance to revise the code) but note how FF and the 
others place the rotated text at different positions.

Okay, maybe this is okay, perhaps just a bug in FF? ...

But I'm not sure why we can't use an animateTransform on one of these 
puppies.

Here's what I mean:
//var Oanim=document.createElementNS(xmlns, "animateTransform")
   //Oanim.setAttribute("attributeName","transform")
   //Oanim.setAttribute("type","rotate")
   //Oanim.setAttribute("dur",2.5)
   //Oanim.setAttribute("from","360,280,175")
   //Oanim.setAttribute("to","0,280,175")
   //Oanim.setAttribute("repeatCount","indefinite")

Above doesn't work (though it would allow me to set the center of rotation)


   var Oanim=document.createElementNS(xmlns, "animate")
   Oanim.setAttribute("attributeName","rotate")
   Oanim.setAttribute("dur",2.5)
   Oanim.setAttribute("from","360")
   Oanim.setAttribute("to","0")
   Oanim.setAttribute("repeatCount","indefinite")

This does work (at least in IE/ASV and Opera) but it doesn't allow me to set 
the center of rotation. Basically I want letters to rotate about the centers 
of their own bounding boxes.

Why do we have these rather funny "rotate" attributes on <tspan>s but 
transform="rotate" on everything else?

Is there any way to animate the rotation of a tspan about a different 
centroid?

I suppose I will have to build fonts and then after parsing a word into 
animation-worthy subglyph sequences I'll swap back in the corresponding 
paths of the letters of the substring for the duration of an animation?? 
Yuck -- not very declarative is it?!

regards
David
Received on Saturday, 13 November 2010 20:25:50 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:46 GMT