class PHPExcel_Style_Font extends PHPExcel_Style_Supervisor implements PHPExcel_IComparable

PHPExcelStyleFont

Copyright (c) 2006 - 2015 PHPExcel

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Constants

UNDERLINE_NONE

UNDERLINE_DOUBLE

UNDERLINE_DOUBLEACCOUNTING

UNDERLINE_SINGLE

UNDERLINE_SINGLEACCOUNTING

Methods

__construct(boolean $isSupervisor = false, boolean $isConditional = false)

Create a new PHPExcelStyleFont

bindParent($parent, $parentPropertyName = null)

Bind parent. Only used for supervisor

boolean
getIsSupervisor()

Is this a supervisor or a cell style component?

getActiveSheet()

Get the currently active sheet. Only used for supervisor

string
getSelectedCells()

Get the currently active cell coordinate in currently active sheet.

string
getActiveCell()

Get the currently active cell coordinate in currently active sheet.

__clone()

Implement PHP __clone to create a deep clone, not just a shallow copy.

getSharedComponent()

Get the shared style component for the currently active cell in currently active sheet.

array
getStyleArray(array $array)

Build style array from subcomponents

applyFromArray(array $pStyles = null)

Apply styles from array

string
getName()

Get Name

setName(string $pValue = 'Calibri')

Set Name

double
getSize()

Get Size

setSize(double $pValue = 10)

Set Size

boolean
getBold()

Get Bold

setBold(boolean $pValue = false)

Set Bold

boolean
getItalic()

Get Italic

setItalic(boolean $pValue = false)

Set Italic

boolean
getSuperScript()

Get SuperScript

setSuperScript(boolean $pValue = false)

Set SuperScript

boolean
getSubScript()

Get SubScript

setSubScript(boolean $pValue = false)

Set SubScript

string
getUnderline()

Get Underline

setUnderline(string|boolean $pValue = self::UNDERLINE_NONE)

Set Underline

boolean
getStrikethrough()

Get Strikethrough

setStrikethrough(boolean $pValue = false)

Set Strikethrough

string
getHashCode()

Get hash code

Details

at line 119
__construct(boolean $isSupervisor = false, boolean $isConditional = false)

Create a new PHPExcelStyleFont

Parameters

boolean $isSupervisor Flag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are
boolean $isConditional Flag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are

PHPExcel_Style_Supervisor bindParent($parent, $parentPropertyName = null)

Bind parent. Only used for supervisor

Parameters

$parent
$parentPropertyName

Return Value

PHPExcel_Style_Supervisor

boolean getIsSupervisor()

Is this a supervisor or a cell style component?

Return Value

boolean

PHPExcel_Worksheet getActiveSheet()

Get the currently active sheet. Only used for supervisor

Return Value

PHPExcel_Worksheet

string getSelectedCells()

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Return Value

string E.g. 'A1'

string getActiveCell()

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

Return Value

string E.g. 'A1'

__clone()

Implement PHP __clone to create a deep clone, not just a shallow copy.

at line 150
PHPExcel_Style_Font getSharedComponent()

Get the shared style component for the currently active cell in currently active sheet.

Only used for style supervisor

Return Value

PHPExcel_Style_Font

at line 161
array getStyleArray(array $array)

Build style array from subcomponents

Parameters

array $array

Return Value

array

at line 188
PHPExcel_Style_Font applyFromArray(array $pStyles = null)

Apply styles from array

$objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray( array( 'name' => 'Arial', 'bold' => TRUE, 'italic' => FALSE, 'underline' => PHPExcelStyleFont::UNDERLINE_DOUBLE, 'strike' => FALSE, 'color' => array( 'rgb' => '808080' ) ) );

Parameters

array $pStyles Array containing style information

Return Value

PHPExcel_Style_Font

Exceptions

PHPExcel_Exception

at line 233
string getName()

Get Name

Return Value

string

at line 247
PHPExcel_Style_Font setName(string $pValue = 'Calibri')

Set Name

Parameters

string $pValue

Return Value

PHPExcel_Style_Font

at line 266
double getSize()

Get Size

Return Value

double

at line 280
PHPExcel_Style_Font setSize(double $pValue = 10)

Set Size

Parameters

double $pValue

Return Value

PHPExcel_Style_Font

at line 299
boolean getBold()

Get Bold

Return Value

boolean

at line 313
PHPExcel_Style_Font setBold(boolean $pValue = false)

Set Bold

Parameters

boolean $pValue

Return Value

PHPExcel_Style_Font

at line 332
boolean getItalic()

Get Italic

Return Value

boolean

at line 346
PHPExcel_Style_Font setItalic(boolean $pValue = false)

Set Italic

Parameters

boolean $pValue

Return Value

PHPExcel_Style_Font

at line 365
boolean getSuperScript()

Get SuperScript

Return Value

boolean

at line 379
PHPExcel_Style_Font setSuperScript(boolean $pValue = false)

Set SuperScript

Parameters

boolean $pValue

Return Value

PHPExcel_Style_Font

at line 399
boolean getSubScript()

Get SubScript

Return Value

boolean

at line 413
PHPExcel_Style_Font setSubScript(boolean $pValue = false)

Set SubScript

Parameters

boolean $pValue

Return Value

PHPExcel_Style_Font

at line 433
string getUnderline()

Get Underline

Return Value

string

at line 449
PHPExcel_Style_Font setUnderline(string|boolean $pValue = self::UNDERLINE_NONE)

Set Underline

Parameters

string|boolean $pValue PHPExcelStyleFont underline type If a boolean is passed, then TRUE equates to UNDERLINESINGLE, false equates to UNDERLINENONE

Return Value

PHPExcel_Style_Font

at line 470
boolean getStrikethrough()

Get Strikethrough

Return Value

boolean

at line 484
PHPExcel_Style_Font setStrikethrough(boolean $pValue = false)

Set Strikethrough

Parameters

boolean $pValue

Return Value

PHPExcel_Style_Font

at line 503
PHPExcel_Style_Color getColor()

Get Color

Return Value

PHPExcel_Style_Color

at line 515
PHPExcel_Style_Font setColor(PHPExcel_Style_Color $pValue = null)

Set Color

Parameters

PHPExcel_Style_Color $pValue

Return Value

PHPExcel_Style_Font

Exceptions

PHPExcel_Exception

at line 534
string getHashCode()

Get hash code

Return Value

string Hash code