public function text($str, $size, $x, $y, $font = 'Arial', $rotate = null, $bold = false)
{
$text = $this->resource->addChild('text', $str);
$text->addAttribute('x', $x . $this->units);
$text->addAttribute('y', $y . $this->units);
$text->addAttribute('font-size', $size);
$text->addAttribute('font-family', $font);
if (null !== $this->fillColor) {
$text->addAttribute('fill', $this->fillColor->get(3, true));
if ($this->opacity < 1.0) {
$text->addAttribute('fill-opacity', $this->opacity);
}
}
if (null !== $rotate) {
$text->addAttribute('transform', 'rotate(' . $rotate . ' ' . $x . ',' . $y . ')');
}
if ($bold) {
$text->addAttribute('font-weight', 'bold');
}
return $this;
}