コード例 #1
0
ファイル: TextTest.php プロジェクト: zhangxiaoliu/PHPPdf
 /**
  * @test
  */
 public function breakAt()
 {
     $text = 'a b c d e f g h';
     $words = \explode(' ', $text);
     $node = new Text($text);
     $node->setWidth(3);
     $node->setHeight(96);
     $node->getBoundary()->setNext(0, 200)->setNext(3, 200)->setNext(3, 104)->setNext(0, 104)->close();
     $breakingLine = 30;
     $result = $node->breakAt($breakingLine);
     $this->assertEquals(30, $node->getHeight());
     $this->assertEquals(170, $node->getDiagonalPoint()->getY());
     $this->assertEquals(66, $result->getHeight());
     $this->assertEquals(170, $result->getFirstPoint()->getY());
 }