/** * Gets rtf code for border * @param PHPRtfLite_Border_Format $borderFormat * @param PHPRtfLite $rtf * * @return string rtf code */ private function getBorderRtf(PHPRtfLite_Border_Format $borderFormat, PHPRtfLite $rtf) { $borderRtf = $borderFormat->getNotColoredPartOfContent(); $color = $borderFormat->getColor(); if ($color) { $rtf->addColor($color); $borderRtf .= '\\brdrcf' . $rtf->getColor($color); } return $borderRtf . ' '; }
/** * 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; }