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

add text rotate parameter #81

Closed
wants to merge 2 commits into from
Closed

add text rotate parameter #81

wants to merge 2 commits into from

Conversation

MichalPP
Copy link

add parameter to rotate text to fix bug #80

@meyfa
Copy link
Owner

meyfa commented Jul 13, 2020

Thanks for wanting to help, always appreciated. Unfortunately, I cannot merge this PR. Reasons:

  • The proposed change is making use of an attribute rotate2, which is not part of the SVG specification.
  • The code contains double quotes / string interpolation, which should be avoided.
  • But most importantly, this is way too specific. It disregards preexisting transform attributes and style properties and transforms on elements other than texts.

Note also that the setRotate method should probably be setTransform and should be located higher up the inheritance chain, as it is not specific to text elements.

@meyfa meyfa closed this Jul 13, 2020
@MichalPP
Copy link
Author

I did not know how to store a parameter, so I misused a non-standard non-used SVG parameter (ugly hack).

the new setRotate f: SVG and GD use different centers of rotation. for SVG output, I have to manually set the center of rotation at the beginning of the text. to avoid retyping of the same XY coordinates, I've created an extra function. plus GD rotate is -1 times SVG rotate.

afaik, there is no basic rotate parameter in PHP GD output apart from texts. eg, to rotate a rectangle, one would have to calculate the points of SVG rectangle, rotate and use imagefilledpolygon. skewing is yet another story :(

I don't think a generic setTransform will be usable to generate both SVG and PHP GD outputs.

@meyfa meyfa added feature New feature or request wontfix This will not be worked on labels Oct 6, 2020
@MichalPP MichalPP mentioned this pull request Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants