PHPExcel: Setting font size?
Use setSize
method instead setFontSize
, it should work:
$objPHPExcel->getActiveSheet()->getStyle("F1:G1")->getFont()->setSize(16);
If you want to use the style array, then you can do something like this:
$fontStyle = [
'font' => [
'size' => 16
]
];
$workbook->getActiveSheet()
->getStyle("F1:G1")
->applyFromArray($fontStyle);