示例#1
0
 /**
  * Read text.
  *
  * @return void
  */
 private function readText()
 {
     $text = $this->textrun->addText($this->text);
     if (isset($this->flags['styles']['font'])) {
         $text->getFontStyle()->setStyleByArray($this->flags['styles']['font']);
     }
 }
示例#2
0
 /**
  * Add footnote
  */
 public function testCreateFootnote()
 {
     $oTextRun = new TextRun();
     $oTextRun->setPhpWord(new PhpWord());
     $element = $oTextRun->addFootnote();
     $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Footnote', $element);
     $this->assertCount(1, $oTextRun->getElements());
 }
示例#3
0
 /**
  * Add textrun element
  *
  * @param mixed $paragraphStyle
  * @return TextRun
  */
 public function addTextRun($paragraphStyle = null)
 {
     $this->checkValidity('textrun');
     $textRun = new TextRun($paragraphStyle);
     $textRun->setDocPart($this->getDocPart(), $this->getDocPartId());
     $this->addElement($textRun);
     return $textRun;
 }