Ejemplo n.º 1
0
 /**
  * Gets rtf code of font
  *
  * @param  PHPRtfLite   $rtf
  *
  * @return string rtf code
  */
 public function getContent(PHPRtfLite $rtf)
 {
     $content = $this->_size > 0 ? '\\fs' . $this->_size * 2 . ' ' : '';
     if (!empty($this->_fontFamily)) {
         $rtf->addFont($this->_fontFamily);
         $content .= $rtf->getFont($this->_fontFamily) . ' ';
     }
     if ($this->_color) {
         $rtf->addColor($this->_color);
         $content .= $rtf->getFontColor($this->_color) . ' ';
     }
     if ($this->_backgroundColor) {
         $rtf->addColor($this->_backgroundColor);
         $content .= $rtf->getBackgroundColor($this->_backgroundColor) . ' ';
     }
     $content .= $this->_isBold ? '\\b ' : '';
     $content .= $this->_isItalic ? '\\i ' : '';
     $content .= $this->_isUnderlined ? '\\ul ' : '';
     $content .= $this->_animation ? '\\animtext' . $this->_animation : '';
     $content .= $this->_isStriked ? '\\strike ' . $this->_animation : '';
     $content .= $this->_isDoubleStriked ? '\\striked1 ' . $this->_animation : '';
     return $content;
 }