xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McCormack <...@mcc.id.au>
Subject Re: Rotating text
Date Wed, 26 Sep 2007 10:07:53 GMT
Hi Heiska.

Heiska Anssi:
> Library produces:
> +--------+
> |   AW   |
> |        |
> +--------+
> 
> And it needs to be converted to:
> +--------+
> |   VM   |    // V is A upside down and M is W upside down
> |        |    // note that this is not rotated string, only each letter
> +--------+    // is rotated

Fortunately, getting that effect is quite easy in SVG.  You just need to
use the rotation="" attribute on the <text> elements.  Presumably you
can modify the SVG document before you build the GVT tree.  Find all of
the elements that you need to rotate, then do a:

  elt.setAttributeNS(null, "rotate", "180");

on each one.  Since the rotation is about the point that each glyph is
to be placed (i.e., the bottom left of each glyph) you may need to move
the <text> elements up and right a bit, too.

-- 
Cameron McCormack, http://mcc.id.au/
	xmpp:heycam@jabber.org  ▪  ICQ 26955922  ▪  MSN cam@mcc.id.au

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


Mime
View raw message