예제 #1
0
 /**
  * Set Paragraph style
  *
  * @param   string|array|\PhpOffice\PhpWord\Style\Paragraph $style
  * @return  string|\PhpOffice\PhpWord\Style\Paragraph
  */
 public function setParagraphStyle($style = null)
 {
     if (is_array($style)) {
         $this->paragraphStyle = new Paragraph();
         $this->paragraphStyle->setArrayStyle($style);
     } elseif ($style instanceof Paragraph) {
         $this->paragraphStyle = $style;
     } else {
         $this->paragraphStyle = $style;
     }
     return $this->paragraphStyle;
 }
예제 #2
0
파일: Font.php 프로젝트: kaantunc/MYK-BOR
 /**
  * Create new font style
  *
  * @param string $type Type of font
  * @param array $paragraphStyle Paragraph styles definition
  */
 public function __construct($type = 'text', $paragraphStyle = null)
 {
     $this->type = $type;
     if ($paragraphStyle instanceof Paragraph) {
         $this->paragraphStyle = $paragraphStyle;
     } elseif (is_array($paragraphStyle)) {
         $this->paragraphStyle = new Paragraph();
         $this->paragraphStyle->setArrayStyle($paragraphStyle);
     } else {
         $this->paragraphStyle = $paragraphStyle;
     }
 }