/** * Set default style - should only be used by IReader implementations! * * @deprecated * @param Style $value * @throws Exception * @return Worksheet */ public function setDefaultStyle(Style $pValue) { $this->_parent->getDefaultStyle()->applyFromArray(array('font' => array('name' => $pValue->getFont()->getName(), 'size' => $pValue->getFont()->getSize()))); return $this; }
/** * Set the style to use for future drawing operations on this page * * @param \Zend\Pdf\Style $style * @return \Zend\Pdf\Page */ public function setStyle(Style $style) { $this->_style = $style; $this->_addProcSet('Text'); $this->_addProcSet('PDF'); if ($style->getFont() !== null) { $this->setFont($style->getFont(), $style->getFontSize()); } $this->_contents .= $style->instructions($this->_pageDictionary->Resources); return $this; }
/** * Write Cell Style Dxf * * @param Shared_XMLWriter $objWriter XML Writer * @param Style $pStyle Style * @throws Exception */ private function _writeCellStyleDxf(Shared_XMLWriter $objWriter = null, Style $pStyle = null) { // dxf $objWriter->startElement('dxf'); // font $this->_writeFont($objWriter, $pStyle->getFont()); // numFmt $this->_writeNumFmt($objWriter, $pStyle->getNumberFormat()); // fill $this->_writeFill($objWriter, $pStyle->getFill()); // alignment $objWriter->startElement('alignment'); $objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal()); $objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical()); $textRotation = 0; if ($pStyle->getAlignment()->getTextRotation() >= 0) { $textRotation = $pStyle->getAlignment()->getTextRotation(); } else { if ($pStyle->getAlignment()->getTextRotation() < 0) { $textRotation = 90 - $pStyle->getAlignment()->getTextRotation(); } } $objWriter->writeAttribute('textRotation', $textRotation); $objWriter->endElement(); // border $this->_writeBorder($objWriter, $pStyle->getBorders()); // protection if ($pStyle->getProtection()->getLocked() != Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != Style_Protection::PROTECTION_INHERIT) { $objWriter->startElement('protection'); if ($pStyle->getProtection()->getLocked() != Style_Protection::PROTECTION_INHERIT) { $objWriter->writeAttribute('locked', $pStyle->getProtection()->getLocked() == Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'); } if ($pStyle->getProtection()->getHidden() != Style_Protection::PROTECTION_INHERIT) { $objWriter->writeAttribute('hidden', $pStyle->getProtection()->getHidden() == Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'); } $objWriter->endElement(); } $objWriter->endElement(); }
/** * Create CSS style * * @param Style $pStyle Style * @return array */ private function _createCSSStyle(Style $pStyle) { // Construct CSS $css = ''; // Create CSS $css = array_merge($this->_createCSSStyleAlignment($pStyle->getAlignment()), $this->_createCSSStyleBorders($pStyle->getBorders()), $this->_createCSSStyleFont($pStyle->getFont()), $this->_createCSSStyleFill($pStyle->getFill())); // Return return $css; }