You are here

public function PHPExcel_Writer_Excel2007_Style::allFonts in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Style.php \PHPExcel_Writer_Excel2007_Style::allFonts()

* Get an array of all fonts * *

Parameters

PHPExcel $pPHPExcel: * @return PHPExcel_Style_Font[] All fonts in PHPExcel * @throws PHPExcel_Writer_Exception

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Style.php, line 649

Class

PHPExcel_Writer_Excel2007_Style
PHPExcel_Writer_Excel2007_Style

Code

public function allFonts(PHPExcel $pPHPExcel = null) {

  // Get an array of unique fonts
  $aFonts = array();
  $aStyles = $this
    ->allStyles($pPHPExcel);
  foreach ($aStyles as $style) {
    if (!array_key_exists($style
      ->getFont()
      ->getHashCode(), $aFonts)) {
      $aFonts[$style
        ->getFont()
        ->getHashCode()] = $style
        ->getFont();
    }
  }
  return $aFonts;
}