/**
  * Enter description here...
  *
  * @param FontStyle $fstyle
  * @return String
  */
 public function fontStyleToCss($fstyle)
 {
     $css = ".c" . $fstyle->getId() . "{";
     //$css .= "font-family:". $fstyle->getFontId().";";
     $css .= "font-size:" . $fstyle->getFontSize() . ";";
     if ($fstyle->getFontBold()) {
         $css .= "font-weight:bold;";
     }
     if ($fstyle->getFontItalic()) {
         $css .= "font-style:italic;";
     }
     if ($fstyle->getFontUnderline()) {
         $css .= "text-decoration:underline;";
     }
     $css .= "color:" . $fstyle->getFontColor();
     return $css . "}";
 }
Exemple #2
0
		public function fromJson($obj){
			$this->bookId = $obj->bookId;
			$this->bookName =$obj->bookName;
			$this->userId = $obj->userId;

			foreach ($obj->sheets as $index => $sheet){
				$newsheet = new Sheet();
				$newsheet->fromJson($sheet);
				$newsheet->bookId=$this->bookId;
				$this->addSheet($newsheet);
			}

			if (is_array($obj->fontStyles)) {
				foreach ($obj->fontStyles as $fontStyle){
					$newFontStyle = new FontStyle();
					$newFontStyle->fromJson($fontStyle);
					$newFontStyle->bookId=$this->bookId;
					$this->addFontStyle($newFontStyle);
				}
			}
		}
 /**
  * @param FontStyle $style
  */
 public function update(FontStyle $style)
 {
     $this->setName($style->getName());
     $this->setStyle($style->getStyle());
     $this->setSize($style->getSize());
     $this->setHAlign($style->getHAlign());
     $this->setVAlign($style->getVAlign());
 }