当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPExcel_Style::getFont方法代码示例

本文整理汇总了PHP中PHPExcel_Style::getFont方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPExcel_Style::getFont方法的具体用法?PHP PHPExcel_Style::getFont怎么用?PHP PHPExcel_Style::getFont使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHPExcel_Style的用法示例。


在下文中一共展示了PHPExcel_Style::getFont方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: propertyBeginBind

 /**
  * Property Begin Bind
  *
  * If no PHPExcel_Style_Font has been bound to PHPExcel_Style then bind this one. Return the actual bound one.
  *
  * @return PHPExcel_Style_Font
  */
 private function propertyBeginBind()
 {
     if (!isset($this->_parent)) {
         return $this;
     }
     // I am already bound
     if ($this->_parent->propertyIsBound($this->_parentPropertyName)) {
         return $this->_parent->getFont();
     }
     // Another one is already bound
     $this->_parent->propertyCompleteBind($this, $this->_parentPropertyName);
     // Bind myself
     $this->_parent = null;
     return $this;
 }
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:22,代码来源:Font.php

示例2: setDefaultStyle

 /**
  * Set default style - should only be used by PHPExcel_IReader implementations!
  *
  * @deprecated
  * @param PHPExcel_Style $pValue
  * @throws PHPExcel_Exception
  * @return PHPExcel_Worksheet
  */
 public function setDefaultStyle(PHPExcel_Style $pValue)
 {
     $this->_parent->getDefaultStyle()->applyFromArray(array('font' => array('name' => $pValue->getFont()->getName(), 'size' => $pValue->getFont()->getSize())));
     return $this;
 }
开发者ID:andrelotto,项目名称:EmailMarketing,代码行数:13,代码来源:Worksheet.php

示例3: _createCSSStyle

 /**
  * Create CSS style
  *
  * @param	PHPExcel_Style		$pStyle			PHPExcel_Style
  * @return	array
  */
 private function _createCSSStyle(PHPExcel_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;
 }
开发者ID:adit-gudhel,项目名称:simpus-dev,代码行数:15,代码来源:HTML.php

示例4: _writeCellStyleDxf

 /**
  * Write Cell Style Dxf
  *
  * @param 	PHPExcel_Shared_XMLWriter 		$objWriter 		XML Writer
  * @param 	PHPExcel_Style					$pStyle			Style
  * @throws 	Exception
  */
 private function _writeCellStyleDxf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_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() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
         $objWriter->startElement('protection');
         if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
             $objWriter->writeAttribute('locked', $pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false');
         }
         if ($pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
             $objWriter->writeAttribute('hidden', $pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false');
         }
         $objWriter->endElement();
     }
     $objWriter->endElement();
 }
开发者ID:echoOly,项目名称:php_base,代码行数:46,代码来源:Style.php

示例5: date

error_reporting(E_ALL);
ini_set('display_errors', true);
ini_set('display_startup_errors', true);
date_default_timezone_set('Europe/London');
define('EOL', PHP_SAPI == 'cli' ? PHP_EOL : '<br />');
date_default_timezone_set('Europe/London');
/** Include PHPExcel */
require_once dirname(__FILE__) . '/../Classes/PHPExcel.php';
echo date('H:i:s'), " Create new PHPExcel object", EOL;
$objPHPExcel = new PHPExcel();
$worksheet = $objPHPExcel->getActiveSheet();
echo date('H:i:s'), " Create styles array", EOL;
$styles = array();
for ($i = 0; $i < 10; $i++) {
    $style = new PHPExcel_Style();
    $style->getFont()->setSize($i + 4);
    $styles[] = $style;
}
echo date('H:i:s'), " Add data (begin)", EOL;
$t = microtime(true);
for ($col = 0; $col < 50; $col++) {
    for ($row = 0; $row < 100; $row++) {
        $str = $row + $col;
        $style = $styles[$row % 10];
        $coord = PHPExcel_Cell::stringFromColumnIndex($col) . ($row + 1);
        $worksheet->setCellValue($coord, $str);
        $worksheet->duplicateStyle($style, $coord);
    }
}
$d = microtime(true) - $t;
echo date('H:i:s'), " Add data (end), time: " . round($d, 2) . " s", EOL;
开发者ID:BozzaCoon,项目名称:SPHERE-Framework,代码行数:31,代码来源:40duplicateStyle.php

示例6: _createCSSStyle

 /**
  * Create CSS style
  * 
  * @param	PHPExcel_Style 		$pStyle			PHPExcel_Style
  * @return	string
  */
 private function _createCSSStyle(PHPExcel_Style $pStyle)
 {
     // Construct HTML
     $html = '';
     // Create CSS
     $html .= '      .style' . $pStyle->getHashCode() . ' {' . "\r\n";
     $html .= $this->_createCSSStyleAlignment($pStyle->getAlignment());
     $html .= $this->_createCSSStyleFont($pStyle->getFont());
     $html .= $this->_createCSSStyleBorders($pStyle->getBorders());
     $html .= $this->_createCSSStyleFill($pStyle->getFill());
     $html .= '      }' . "\r\n";
     // Return
     return $html;
 }
开发者ID:laiello,项目名称:myopensources,代码行数:20,代码来源:HTML.php

示例7: array

		/**
		 * Generates the sheet's workbook...
		 *
		 * @param String format extension
		 */
		function _generateSheets($format){


			$sheets= array();
			$sheets= $this->book->getSheets();
			$i= 0;


			if ($format=="ods"){

				foreach($sheets as $sheet){

					$cells= array();
					$cells= $sheet->getCells();


					foreach($cells as $cellarray){

						foreach($cellarray as $cell){

						$col= $cell->getDataColumn();
						$row= $cell->getDataRow();
						$data= $cell->getFormula();
						$fontId= $cell->getFontStyleId();
						$fontStyle= new FontStyle();
						$fontStyle= $this->book->getFontStyle($fontId);
						
						

						if (substr($data, 0, 1)== '=')

							$this->objPHPOds->addCell($i,$row,$col,substr($data, 1),'float');
							

						//TODO
						else /*OJO CON ESTO DISCERNIR ENTRE LOS DIFERENTES TIPOS*/

							$this->objPHPOds->addCell($i,$row,$col,$data,'string');

						}
						$this->objPHPOds->addStyle($fontStyle, $cell);
					}
					$i++;
				}
			}
			else{

				foreach($sheets as $sheet){

					if ($i>0)
						$this->objPHPExcel->createSheet();

					$this->objPHPExcel->setActiveSheetIndex($i);
					$j= $i + 1;
					$this->objPHPExcel->getActiveSheet()->setTitle("Sheet $j");

					$cells= array();
					
					$cells= $sheet->getCells();

					foreach($cells as $cellarray){

						$cell= new Cell();
						foreach ($cellarray as $cell){

						
							$col= $cell->getDataColumn();
							$row= $cell->getDataRow();
							$row++;
							
							$data= $cell->getFormula();
//							$this->objPHPExcel= new PHPExcel();
							
							
							$fontId= $cell->getFontStyleId();
							$fontStyle= new FontStyle();
							$fontStyle= $this->book->getFontStyle($fontId);
							$fontName= $fontStyle->getFontName();	
							$fcolor= substr($fontStyle->getFontColor(),1);
							
							if ($fcolor == "000000"){ 
								//echo "$row $col $fcolor<hr>";
							 	$ncolor= new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK);
							 	$ncolor->setRGB($fcolor);							 	
							}
							else{
								//echo "$row $col $fcolor<hr>";
								$ncolor= new PHPExcel_Style_Color();
								$ncolor->setRGB($fcolor);				
							}	
							
							$style= new PHPExcel_Style();
							$style->getFont()->setColor($ncolor);
							$style->getFont()->setName($fontName);
							$style->getFont()->setBold($fontStyle->getFontBold()== 1);
//.........这里部分代码省略.........
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:101,代码来源:ExportController.class.php


注:本文中的PHPExcel_Style::getFont方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。