lib/PHPRtfLite/Font.php
public function getContent()
    {
        $content = '';

        if ($this->_size > 0) {
            $content .= '\fs' . ($this->_size * 2) . ' ';
        }

        if ($this->_fontFamily && $this->_fontTable) {
            $fontIndex = $this->_fontTable->getFontIndex($this->_fontFamily);
            if ($fontIndex !== false) {
                $content .= '\f' . $fontIndex . ' ';
            }
        }

        if ($this->_color && $this->_colorTable) {
            $colorIndex = $this->_colorTable->getColorIndex($this->_color);
            if ($colorIndex !== false) {
                $content .= '\cf' . $colorIndex . ' ';
            }
        }

        if ($this->_backgroundColor && $this->_colorTable) {
            $colorIndex = $this->_colorTable->getColorIndex($this->_backgroundColor);
            if ($colorIndex !== false) {
                $content .= '\chcbpat' . $colorIndex . ' ';
            }
        }

        if ($this->_isBold) {
            $content .= '\b ';
        }
        if ($this->_isItalic) {
            $content .= '\i ';
        }
        if ($this->_isUnderlined) {
            $content .= '\ul ';
        }
        if ($this->_animation) {
            $content .= '\animtext' . $this->_animation;
        }
        if ($this->_isStriked) {
            $content .= '\strike ' . $this->_animation;
        }
        elseif ($this->_isDoubleStriked) {
            $content .= '\striked1 ' . $this->_animation;
        }

        return $content;
    }
public function getContent()
    {
        $content = '';

        if ($this->_size > 0) {
            $content .= '\fs' . ($this->_size * 2) . ' ';
        }

        if ($this->_fontFamily && $this->_fontTable) {
            $fontIndex = $this->_fontTable->getFontIndex($this->_fontFamily);
            if ($fontIndex !== false) {
                $content .= '\f' . $fontIndex . ' ';
            }
        }

        if ($this->_color && $this->_colorTable) {
            $colorIndex = $this->_colorTable->getColorIndex($this->_color);
            if ($colorIndex !== false) {
                $content .= '\cf' . $colorIndex . ' ';
            }
        }

        if ($this->_backgroundColor && $this->_colorTable) {
            $colorIndex = $this->_colorTable->getColorIndex($this->_backgroundColor);
            if ($colorIndex !== false) {
                $content .= '\chcbpat' . $colorIndex . ' ';
            }
        }

        if ($this->_isBold) {
            $content .= '\b ';
        }
        if ($this->_isItalic) {
            $content .= '\i ';
        }
        if ($this->_isUnderlined) {
            $content .= '\ul ';
        }
        if ($this->_animation) {
            $content .= '\animtext' . $this->_animation;
        }
        if ($this->_isStriked) {
            $content .= '\strike ' . $this->_animation;
        }
        elseif ($this->_isDoubleStriked) {
            $content .= '\striked1 ' . $this->_animation;
        }

        return $content;
    }
public function getContent ( ) { $ content = '' ; if ( $ this -> _size > 0 ) { $ content .= '\fs' . ( $ this -> _size * 2 ) . ' ' ; } if ( $ this -> _fontFamily && $ this -> _fontTable ) { $ fontIndex = $ this -> _fontTable -> getFontIndex ( $ this -> _fontFamily ) ; if ( $ fontIndex !== false ) { $ content .= '\f' . $ fontIndex . ' ' ; } } if ( $ this -> _color && $ this -> _colorTable ) { $ colorIndex = $ this -> _colorTable -> getColorIndex ( $ this -> _color ) ; if ( $ colorIndex !== false ) { $ content .= '\cf' . $ colorIndex . ' ' ; } } if ( $ this -> _backgroundColor && $ this -> _colorTable ) { $ colorIndex = $ this -> _colorTable -> getColorIndex ( $ this -> _backgroundColor ) ; if ( $ colorIndex !== false ) { $ content .= '\chcbpat' . $ colorIndex . ' ' ; } } if ( $ this -> _isBold ) { $ content .= '\b ' ; } if ( $ this -> _isItalic ) { $ content .= '\i ' ; } if ( $ this -> _isUnderlined ) { $ content .= '\ul ' ; } if ( $ this -> _animation ) { $ content .= '\animtext' . $ this -> _animation ; } if ( $ this -> _isStriked ) { $ content .= '\strike ' . $ this -> _animation ; } elseif ( $ this -> _isDoubleStriked ) { $ content .= '\striked1 ' . $ this -> _animation ; } return $ content ; }
gets rtf code of font

@return string rtf code
gets rtf code of font