本文整理匯總了PHP中Style::getFont方法的典型用法代碼示例。如果您正苦於以下問題:PHP Style::getFont方法的具體用法?PHP Style::getFont怎麽用?PHP Style::getFont使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Style
的用法示例。
在下文中一共展示了Style::getFont方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setDefaultStyle
/**
* 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;
}
示例2: setStyle
/**
* 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;
}
示例3: _writeCellStyleDxf
/**
* 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();
}
示例4: _createCSSStyle
/**
* 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;
}