phMagick :: Drawing text
it's quite easy to do create an image containing a string
$pmMagick->fromString('My text');
and you will end up with an image with the default formatting containing the text My text . You can apply some formatting to the text, font name, size, color, and background.
Draw using the default format
$phMagick = &new phMagick(); $phMagick->setDestination('text.png') ->fromString('phMagick rules!!!!!');
result:

Changing the default format
As the default formatting may not suit you, you can change the system wide default values of phpMagick without messing with phMagick code so you don't have to do it every time
phMagickTextObject::defaultColor('#f00'); phMagickTextObject::defaultFontSize(55); $phMagick = &new phMagick(); $phMagick->setDestination('text1.png') ->fromString('phMagick rules!!!!!');
result:

Using a custom format
$format = new phMagickTextObject(); $format->fontSize(48) ->font('Arial.ttf') ->color('#fff') ->background('#fd3ab5'); $phMagick = &new phMagick(); $phMagick->setDestination('text-custom.png') ->fromString('phMagick rules!!!!!', $format);
result:

Is it possible to use p div tags and text formatting in phMagic ?
Hi
Can you draw tables with your wrapper class?
In the meantime I will work with tabs/spaces but would be very useful if there was a library for tables
Let me know! Thanks
Is it possible to draw East Asian Utf-8 fonts?
Example Bengali text could be, বাংলাদেশ
@Marius
No, that is not supported at the moment
@Shiplu,
It should be possible if your font supports that chars, just need to set the full path to the font you want to use
Would it be possible to add text on an image where two words have different font colors?
Thanks in advance
@Fynn
yes it is, but is not straitforward
you must create an image for each word, and then join them into one with the tile( array(‘image1′,’image2′ )) function