Create dynamically a vertical button in php
<p>I'm trying to create a vertical button in PHP, but I have problem with the positioning, when I created a 200px height and 40px width PNG i want to put the text to the center of that image. The text long will be changing dynamically </p>

<p>this is a part of my code</p>

<pre><code>$image = imagecreate($this-&gt;width , $this-&gt;height);
$background = ImageColorAllocate($image, $this-&gt;bg_red, $this-&gt;bg_grn, $this-&gt;bg_blu);
$foreground = ImageColorAllocate($image, $this-&gt;red, $this-&gt;grn, $this-&gt;blu);

if ($this-&gt;transparent) ImageColorTransparent($image, $background);
ImageInterlace($image, false);
// render the image
ImageTTFText($image, $this-&gt;size, $this-&gt;rot, $offset_x, $offset_y, $foreground, $this-&gt;font, $this-&gt;msg); 
</code></pre>

<p>how can I calculate the <code>$offset_x</code> and <code>$offset_y</code>?</p>
