PHPRtfLite::getColorTable PHP Метод

getColorTable() публичный Метод

gets color table
public getColorTable ( ) : PHPRtfLite_DocHead_ColorTable
Результат PHPRtfLite_DocHead_ColorTable
    public function getColorTable()
    {
        if ($this->_colorTable === null) {
            $this->_colorTable = new PHPRtfLite_DocHead_ColorTable();
        }
        return $this->_colorTable;
    }

Usage Example

Пример #1
0
 /**
  * renders list
  */
 public function render()
 {
     $stream = $this->_rtf->getWriter();
     $number = 0;
     foreach ($this->_items as $item) {
         // item is a list
         if ($item instanceof PHPRtfLite_List_Numbering) {
             if ($this instanceof PHPRtfLite_List_Numbering) {
                 $item->setPrefix($this->_prefix . $this->getNumber($number) . $this->_separator);
                 $item->setSuffix($this->_suffix);
             }
         } else {
             $number++;
             $listCharFontIndex = $this->getListCharFontIndex();
             $listCharacter = $this->getListCharacter($number);
             $listCharDefinition = '{\\*\\pn\\pnlvlblt' . '\\pnf' . $listCharFontIndex;
             if ($this->_font) {
                 $listCharDefinition .= '\\pnfs' . $this->_font->getSize() * 2;
                 if ($color = $this->_font->getColor()) {
                     $listCharDefinition .= '\\pncf' . $this->_rtf->getColorTable()->getColorIndex($color);
                 }
             }
             $listCharDefinition .= '\\pnindent0{\\pntxtb ' . $listCharacter . '}}';
             $textIndent = $this->_listIndent + $this->_textIndent;
             $stream->write('\\nowidctlpar\\fi-' . $this->_listIndent . '\\li' . $textIndent . "\r\n");
             $stream->write($listCharDefinition);
         }
         // renders item
         $item->render();
         if (false == $item instanceof PHPRtfLite_List) {
             $stream->write('\\par\\pard' . "\r\n");
         }
     }
 }
All Usage Examples Of PHPRtfLite::getColorTable