Exemplo n.º 1
0
 /**
  * tests getContent().
  */
 public function testGetContent()
 {
     $this->_font->setBold();
     $this->_font->setItalic();
     $this->_font->setUnderline();
     $this->_font->setAnimation(PHPRtfLite_Font::ANIMATE_LAS_VEGAS_LIGHTS);
     $this->_font->setDoubleStriked();
     $this->assertEquals('\\fs20 \\b \\i \\ul \\animtext1\\striked1 1', trim($this->_font->getContent()));
 }
Exemplo n.º 2
0
 /**
  * Add a new style
  * @param @stylename style name
  * @param @fontface  font face
  * @param @fontsize  font size
  * @param @fontstyle font style (B=bold, I=italic)
  * @param @fontcolor font color
  * @param @fillcolor fill color
  */
 public function addStyle($stylename, $fontface, $fontsize, $fontstyle, $fontcolor, $fillcolor)
 {
     // instancia um objeto para estilo de fonte (PHPRtfLite_Font)
     $font = new PHPRtfLite_Font($fontsize, $fontface, $fontcolor);
     $font->setBold(strstr($fontstyle, 'B'));
     $font->setItalic(strstr($fontstyle, 'I'));
     $font->setUnderline(strstr($fontstyle, 'U'));
     //  armazena o objeto fonte e a cor de preenchimento
     $this->styles[$stylename]['font'] = $font;
     $this->styles[$stylename]['bgcolor'] = $fillcolor;
 }