THESE CODES ARE PROVIDED FOR AN EXAMPLE OF HOW TO USE IMAGEMAGICK WITH PHP. CARE SHOULD BE TAKEN WHEN ACCEPTING USER INPUT.
I TAKE NO RESPONSABILTY FOR ANY PROBLEMS THAT MAY OCCURE WHEN USING ANY OF THIS CODE.
IT IS UP TO YOU TO SECURE THE CODE AND VALIDATE USER INPUT.
Image magick is not a word processor and so the font manipulations are very basic.
Showing font styled to Italic
ImageMagick for some reason as well is changing the font to bold !
exec("convert -size 230x130 xc:lightblue -font verdana.ttf -pointsize 25 -style italic -draw \"gravity NorthWest fill black text 0,0 'The quick red fox jumped over the lazy brown dog'\" font1.png");
Showing font underlined
exec("convert -size 230x130 xc:lightblue -font verdana.ttf -pointsize -draw \"gravity NorthWest fill black Decorate Underline text 0,0 'The quick red fox jumped over the lazy brown dog.'\" font2.png");