_type = $type; $this->_name = 'Arial'; $this->_size = 20; $this->_bold = false; $this->_italic = false; $this->_superScript = false; $this->_subScript = false; $this->_underline = PHPWord_Style_Font::UNDERLINE_NONE; $this->_strikethrough = false; $this->_color = '000000'; $this->_fgColor = null; if(!is_null($styleParagraph)) { $paragraph = new PHPWord_Style_Paragraph(); foreach($styleParagraph as $key => $value) { if(substr($key, 0, 1) != '_') { $key = '_'.$key; } $paragraph->setStyleValue($key, $value); } $this->_paragraphStyle = $paragraph; } else { $this->_paragraphStyle = null; } } public function getName() { return $this->_name; } public function setStyleValue($key, $value) { if($key == '_size') { $value *= 2; } $this->$key = $value; } public function setName($pValue = 'Arial') { if($pValue == '') { $pValue = 'Arial'; } $this->_name = $pValue; return $this; } public function getSize() { return $this->_size; } public function setSize($pValue = 20) { if($pValue == '') { $pValue = 20; } $this->_size = ($pValue*2); return $this; } public function getBold() { return $this->_bold; } public function setBold($pValue = false) { if($pValue == '') { $pValue = false; } $this->_bold = $pValue; return $this; } public function getItalic() { return $this->_italic; } public function setItalic($pValue = false) { if($pValue == '') { $pValue = false; } $this->_italic = $pValue; return $this; } public function getSuperScript() { return $this->_superScript; } public function setSuperScript($pValue = false) { if($pValue == '') { $pValue = false; } $this->_superScript = $pValue; $this->_subScript = !$pValue; return $this; } public function getSubScript() { return $this->_subScript; } public function setSubScript($pValue = false) { if($pValue == '') { $pValue = false; } $this->_subScript = $pValue; $this->_superScript = !$pValue; return $this; } public function getUnderline() { return $this->_underline; } public function setUnderline($pValue = PHPWord_Style_Font::UNDERLINE_NONE) { if ($pValue == '') { $pValue = PHPWord_Style_Font::UNDERLINE_NONE; } $this->_underline = $pValue; return $this; } public function getStrikethrough() { return $this->_strikethrough; } public function setStrikethrough($pValue = false) { if($pValue == '') { $pValue = false; } $this->_strikethrough = $pValue; return $this; } public function getColor() { return $this->_color; } public function setColor($pValue = '000000') { $this->_color = $pValue; return $this; } public function getFgColor() { return $this->_fgColor; } public function setFgColor($pValue = null) { $this->_fgColor = $pValue; return $this; } public function getStyleType() { return $this->_type; } /** * Get Paragraph style * * @return PHPWord_Style_Paragraph */ public function getParagraphStyle() { return $this->_paragraphStyle; } } ?>