php-svg
php-svg copied to clipboard
text rotate
would it be possible to add rotation of text?
SVG output was fairly easy with something like setAttribute('transform', 'rotate(-45)'), but PNG output is fairly more complicated.
it would need:
- add rotate parameter to
SVGText - "magic" calculation of SVG centre of rotation, so that the centre is identical in SVG output and PHP GD output
- change the 0 parameter of
imagettftextangle inTextRenderer.php
any other glitches I've missed?
some test output of both SVG and PNG here
You're right, this is a much needed feature. But we need to make sure to not limit ourselves to text elements. E.g. #45 tracks rotation of rectangles and #30 tracks (among others) transforms in general.
the solution does not need to be perfect (no perfect solution was found in three years), we could start with simple text (as was in my PR ). other things (rectangles, ...) can follow later.