getColorTable() 공개 메소드

gets color table
public getColorTable ( ) : PHPRtfLite_DocHead_ColorTable
리턴 PHPRtfLite_DocHead_ColorTable
예제 #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");
         }
     }
 }
예제 #2
0
 /**
  * renders cell definition
  */
 public function renderDefinition()
 {
     $stream = $this->_rtf->getWriter();
     if ($this->isVerticalMerged()) {
         if ($this->isVerticalMergedFirstInRange()) {
             $stream->write('\\clvmgf');
         } else {
             $stream->write('\\clvmrg');
         }
     }
     $backgroundColor = $this->getBackgroundColor();
     if ($backgroundColor) {
         $colorTable = $this->_rtf->getColorTable();
         $stream->write('\\clcbpat' . $colorTable->getColorIndex($backgroundColor) . ' ');
     }
     switch ($this->getVerticalAlignment()) {
         case self::VERTICAL_ALIGN_TOP:
             $stream->write('\\clvertalt');
             break;
         case self::VERTICAL_ALIGN_CENTER:
             $stream->write('\\clvertalc');
             break;
         case self::VERTICAL_ALIGN_BOTTOM:
             $stream->write('\\clvertalb');
             break;
     }
     switch ($this->getRotateTo()) {
         case self::ROTATE_RIGHT:
             $stream->write('\\cltxtbrl');
             break;
         case self::ROTATE_LEFT:
             $stream->write('\\cltxbtlr');
             break;
     }
     // NOTE: microsoft and all other rtf readers I know confound left with top cell padding
     if ($this->_paddingLeft) {
         $stream->write('\\clpadft3\\clpadt' . PHPRtfLite_Unit::getUnitInTwips($this->_paddingLeft) . ' ');
     }
     if ($this->_paddingTop) {
         $stream->write('\\clpadfl3\\clpadl' . PHPRtfLite_Unit::getUnitInTwips($this->_paddingTop) . ' ');
     }
     if ($this->_paddingBottom) {
         $stream->write('\\clpadfb3\\clpadb' . PHPRtfLite_Unit::getUnitInTwips($this->_paddingBottom) . ' ');
     }
     if ($this->_paddingRight) {
         $stream->write('\\clpadfr3\\clpadr' . PHPRtfLite_Unit::getUnitInTwips($this->_paddingRight) . ' ');
     }
     $border = $this->getBorder();
     if ($border) {
         $stream->write($border->getContent('\\cl'));
     }
 }
예제 #3
0
파일: Image.php 프로젝트: naivists/PHPUnit
 /**
  * sets paragraph format for image
  *
  * @param PHPRtfLite_ParFormat $parFormat
  */
 public function setParFormat(PHPRtfLite_ParFormat $parFormat)
 {
     $this->_parFormat = $parFormat;
     $parFormat->setColorTable($this->_rtf->getColorTable());
 }
예제 #4
0
 /**
  * sets border format for bottom border
  *
  * @param PHPRtfLite_Border_Format $borderFormat
  */
 public function setBorderBottom(PHPRtfLite_Border_Format $borderFormat)
 {
     $borderFormat->setColorTable($this->_rtf->getColorTable());
     $this->_borderBottom = $borderFormat;
 }