0

EDIT: What I want to achieve can be seen here: http://www.hearthcards.net/

I want that the first character not to be changed. Second and third to be changed by about 2 degress, 4th and 5th to be changed by about 5 degrees and so on... So it would look like this: https://hearthstonehungary.hu/card/38531/aberrant-berserker (the Aberrant Berserker text on the image is rotated)

I have this in the code:

imagettftext($top_image, $font_size, 0(rotation would be this), $position_center, 233, $white, $font, $text);

It's working, but this won't rotate the text, because I set it to 0. I was thinking about replacing that 0 with $rotate and write something like this:

if (strlen($text) == (1)) {
    $rotate=0;
}
else
{
    $rotate=20;
}

So I checked if at least this works and yes it worked, but I don't need "if", I want that text == 1 not to be rotated, text == 2 and text == 3 to be rotated by 2 and so on... May I need to split it to 20 parts(because they can input a maximum of 20 words there)? Any help would be greatly appreciated.

Phoenixy
  • 104
  • 1
  • 14
  • Wouldn't it be easier for you to use Javascript or some JS library as JQuery instead of PHP? – Reger Jan 22 '14 at 12:00
  • 4
    ... or use CSS (since that's what it was designed for) : http://stackoverflow.com/questions/2840862/is-there-a-way-to-curve-arc-text-using-css3-canvas – naththedeveloper Jan 22 '14 at 12:01
  • the first (and last) characters are rotated (and translated) the most!? – bitWorking Jan 22 '14 at 12:15
  • possible duplicate: http://stackoverflow.com/questions/1913342/writing-curved-text-on-an-arc-php – bitWorking Jan 22 '14 at 12:20
  • @redreggae The text starts from the middle, so the first should be the least rotated and the last two (last from left and last from right) the most rotated. – Phoenixy Jan 22 '14 at 13:39
  • @FDL I don't want canvas... If we forget about rotating now, I just want to modify all characters of a user inputted text and I don't know how to do it. – Phoenixy Jan 22 '14 at 13:39

0 Answers0