Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text rotate #80

Open
MichalPP opened this issue Jul 10, 2020 · 3 comments
Open

text rotate #80

MichalPP opened this issue Jul 10, 2020 · 3 comments
Labels
feature New feature or request

Comments

@MichalPP
Copy link

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 imagettftext angle in TextRenderer.php

any other glitches I've missed?

MichalPP added a commit to MichalPP/php-svg that referenced this issue Jul 11, 2020
@MichalPP
Copy link
Author

some test output of both SVG and PNG here

@meyfa meyfa added the feature New feature or request label Jul 13, 2020
@meyfa
Copy link
Owner

meyfa commented Jul 13, 2020

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.

@MichalPP
Copy link
Author

MichalPP commented Apr 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants