title: Draw text with custom font using ImageMagick and PHP
body: <p>I want to dynamically render text to an image with a custom font, preferably with the <em>option to output directly</em> or <em>save to a file</em>. And to <em>automatically set the image size according to the font/size combination</em>.</p>
  
  <p>I can already do this with GD, but it doesn't handle fonts where characters overlay each other.</p>
  
  <p>So now I'm looking to ImageMagick. I've found <a href="http://www.imagemagick.org/Usage/text/#label" rel="nofollow">an example in the docs</a> that seem to do what I want. Is this possible with php_magick? Especially the part where no image size is defined :) If it is not, can I make command-line magick output the raw image, so I can pass it directly to the client with PHP?</p>
  
  <p>Thanks!</p>
  
  <hr>
  
  <p>The real question probably is: How do I convert the IM command below to PHP code using php_magick?</p>
  
  <pre><code>convert -background lightblue -fill blue -font Arial -pointsize 72 label:Anthony
  </code></pre>