/** * {@inheritdoc} */ public function draw(CanvasInterface $canvas, Text $text) { $x = $text->getCoordinate()->getX(); $y = $text->getCoordinate()->getY(); $width = $this->getWidth(); $outlineColor = $this->getColor()->getValue(); $result = true; for ($xc = $x - abs($width); $xc <= $x + abs($width); $xc++) { for ($yc = $y - abs($width); $yc <= $y + abs($width); $yc++) { $result = @imagefttext($canvas->getHandler(), $text->getFontSize(), $text->getAngle(), $xc, $yc + $text->getFontSize(), $outlineColor, $text->getFont(), $text->getString(), array('linespacing' => $text->getLineSpacing())); } } return (bool) ($result && @imagefttext($canvas->getHandler(), $text->getFontSize(), $text->getAngle(), $text->getCoordinate()->getX(), $text->getCoordinate()->getY() + $text->getFontSize(), $text->getColor()->getValue(), $text->getFont(), $text->getString(), array('linespacing' => $text->getLineSpacing()))); }
/** * {@inheritdoc} */ public function draw(CanvasInterface $canvas, Text $text) { return (bool) @imagefttext($canvas->getHandler(), $text->getFontSize(), $text->getAngle(), $text->getCoordinate()->getX(), $text->getCoordinate()->getY() + $text->getFontSize(), $text->getColor()->getValue(), $text->getFont(), $text->getString(), array('linespacing' => $text->getLineSpacing())); }