PhpOffice\PhpPresentation\Shape\RichText\Paragraph::setFont PHP Метод

setFont() публичный Метод

Set font
public setFont ( Font $pFont = null ) : Paragraph
$pFont PhpOffice\PhpPresentation\Style\Font Font
Результат Paragraph
    public function setFont(Font $pFont = null)
    {
        $this->font = $pFont;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Test get/set font
  */
 public function testFont()
 {
     $object = new Paragraph();
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setFont());
     $this->assertNull($object->getFont());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph', $object->setFont(new Font()));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Style\\Font', $object->getFont());
 }