title: php gd vertical text an image
body: <p>I would like to put on a picture in vertical text in PHP:</p>
  
  <pre><code>function scrivi($scrivi, $p) {
      $imgResource = imagecreatefromjpeg($p);
      $textcolor = imagecolorallocate($imgResource, 255, 255, 255);
      $fontPath = "st.ttf";
      $fontSize = "18";
      $rotation = "270"; // counter-clockwise rotation
      $text = "this is a text";
      $textCoords = imagettfbbox($fontSize, $rotation, $fontPath, $text);
      $x = 36;
      $y = 36;
      imagettftext($imgResource, $fontSize, $rotation, $x, $y, $textcolor, $fontPath, $text);
      unlink($p);
      imagejpeg($imgResource, $p, 100);
      imagedestroy($imgResource);
  }
  </code></pre>
  
  <p>It works well only that I would like that the letters are turned this is an example using the function</p>
  
  <p><img src="https://i.stack.imgur.com/0uq6B.jpg" alt="enter image description here"></p>
  
  <p>Instead I would like to</p>
  
  <p><img src="https://i.stack.imgur.com/7nrRU.jpg" alt="enter image description here"></p>
  
  <p>an idea could be to wrap each letter</p>