Re: Cannot change text rotation centre in SVGs

Dirk Schulze:
>On Mar 26, 2013, at 7:56 AM, Antonio Roberts <antonio@hellocatfood.com> 
wrote:
>> Currently, when you rotate text it rotates using the bottom left of
>> the text as its centre.
>
>That is not correct. Currently it uses (0,0) of the coordinate space of the 
>text, which is (if no transform on the ancestor) the top left of the 
>viewport.

I think, this is not related to the transform attribute, but the rotate
attribute for text elements, that can take a list of rotations about the
current text position, for a list in doubt for every glyph. 
As Helder already mentioned, there are some limited options
for authors to have influence on the current text position.
If nothing of this is applied, indeed such a glyph or glyph group
is effectively rotated around its bottom left corner.

See: 
http://www.w3.org/TR/2011/REC-SVG11-20110816/text.html#TextElementRotateAttribute

>
>> Would there ever be the possibility of
>> allowing the text rotation centre to be either of the corners of the
>> bounding box or the centre?
>
>With CSS Transforms there will be a 'transform-origin' presentation attribute 
>that allows you to set the origin. In your case it would be 
>transform-origin="center center".

I think, CSS Transforms currently has no property related to the rotate 
attribute for text elements. Therefore this seems not to be related.
Respectively one has to set each glyph in a separate element that
is transformable.

However due to the efforts to have more properties in SVG representing
the same as currently attributes, may there will be such a property with
a list of rotations?
Could be a good idea to give authors more/simpler options to define the
center of rotation of every glyph relative to the box of the glyph.
Currently one has a few horizontal values with text-anchor and maybe
vertically some control with *baseline* properties (did not check this -
could be maybe more tricky to get the intended effect, because it
shifts the glyph as well, therefore presumably one has to use more than
one glyph.)



Olaf

Received on Saturday, 30 March 2013 16:08:16 UTC