<?php
 class phMagick_text{ function fromString(phmagick $p, $text = '', phMagickTextObject $format = null){ if(is_null($format)) $format = new phMagickTextObject(); $cmd = $p->getBinary('convert'); if ($format->background !== false) $cmd .= ' -background "' . $format->background . '"'; if ($format->color !== false) $cmd .= ' -fill "' . $format->color . '"' ; if ($format->font !== false) $cmd .= ' -font ' . $format->font ; if ($format->fontSize !== false) $cmd .= ' -pointsize ' . $format->fontSize ; if (($format->pText != '') && ($text = '') ) $text = $format->pText ; $cmd .= ' label:"'. $text .'"'; $cmd .= ' "' . $p->getDestination().'"' ; $p->execute($cmd); $p->setSource($p->getDestination()); $p->setHistory($p->getDestination()); return $p ; } } ?>