/**
  * @param AbstractText $text
  *
  * @return AbstractText
  */
 private function addAndInitText(AbstractText $text)
 {
     $text->getFillStyle()->update($this->defaultTextFillStyle);
     $text->getStrokeStyle()->update($this->defaultTextStrokeStyle);
     $text->getFontStyle()->update($this->defaultTextFontStyle);
     $this->add($text);
     return $text;
 }
Ejemplo n.º 2
0
 /**
  * @param SimpleXMLElement $element
  * @param AbstractText $text
  */
 private function addTextStyle(SimpleXMLElement $element, AbstractText $text)
 {
     $this->addFontStyle($element, $text->getFontStyle());
     $this->addFillStyle($element, $text->getFillStyle());
     $this->addStrokeStyle($element, $text->getStrokeStyle());
     if ($text->getOpacity() < 1) {
         $element->addAttribute("opacity", $text->getOpacity());
     }
 }