コード例 #1
0
ファイル: Document.php プロジェクト: doit05/relProject
 /**
  * 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
ファイル: TextRunTest.php プロジェクト: brunodebarros/phpword
 /**
  * Add text non-UTF8
  */
 public function testAddTextNotUTF8()
 {
     $oTextRun = new TextRun();
     $element = $oTextRun->addText(utf8_decode(htmlspecialchars('ééé', ENT_COMPAT, 'UTF-8')));
     $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element);
     $this->assertCount(1, $oTextRun->getElements());
     $this->assertEquals(htmlspecialchars('ééé', ENT_COMPAT, 'UTF-8'), $element->getText());
 }
コード例 #3
0
ファイル: TextRunTest.php プロジェクト: hcvcastro/pxp
 /**
  * Add text non-UTF8
  */
 public function testAddTextNotUTF8()
 {
     $oTextRun = new TextRun();
     $element = $oTextRun->addText(utf8_decode('ééé'));
     $this->assertInstanceOf('PhpOffice\\PhpWord\\Element\\Text', $element);
     $this->assertCount(1, $oTextRun->getElements());
     $this->assertEquals($element->getText(), 'ééé');
 }