PHPExcel_Style

# Class: PHPExcel_Style_Font

Source Location: /PHPExcel/Style/Font.php

### Class Overview

PHPExcel_Style_Font

#### Author(s):

#### Copyright:

- Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

Implements interfaces:

- PHPExcel_IComparable

### Constants

- UNDERLINE_DOUBLE
- UNDERLINE_DOUBLEACCOUNTING
- UNDERLINE_NONE
- UNDERLINE_SINGLE
- UNDERLINE_SINGLEACCOUNTING

### Methods

- __construct
- applyFromArray
- bindParent
- getActiveCell
- getActiveSheet
- getBold
- getColor
- getHashCode
- getIsSupervisor
- getItalic
- getName
- getSelectedCells
- getSharedComponent
- getSize
- getStrikethrough
- getStriketrough
- getStyleArray
- getSubScript
- getSuperScript
- getUnderline
- setBold
- setColor
- setItalic
- setName
- setSize
- setStrikethrough
- setStriketrough
- setSubScript
- setSuperScript
- setUnderline
- __clone

### Class Details

[line 36]
PHPExcel_Style_Font

#### Tags:

copyright: | Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)

[ Top ]

### Class Methods

### constructor __construct [line 139]

`PHPExcel_Style_Font __construct( [boolean $isSupervisor = false], [boolean $isConditional = false])`

Create a new PHPExcel_Style_Font

#### Tags:

access: | public

#### 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

[ Top ]

### method applyFromArray [line 261]

`PHPExcel_Style_Font applyFromArray( [array $pStyles = null])`

Apply styles from array

1. $objPHPExcel-> getActiveSheet ()->getStyle('B2')->getFont()-> applyFromArray (
2. array(
3. 'name' => 'Arial',
4. 'bold' => true,
5. 'italic' => false,
6. 'underline' => PHPExcel_Style_Font ::UNDERLINE_DOUBLE,
7. 'strike' => false,
8. 'color' => array(
9. 'rgb' => '808080'
10. )
11. )
12. );

#### Tags:

throws: | Exception
access: | public

#### Parameters:

array | $pStyles | Array containing style information

[ Top ]

### method bindParent [line 170]

`PHPExcel_Style_Font bindParent( PHPExcel_Style $parent)`

Bind parent. Only used for supervisor

#### Tags:

access: | public

#### Parameters:

PHPExcel_Style | $parent |

[ Top ]

### method getActiveCell [line 223]

`string getActiveCell( )`

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

#### Tags:

return: | E.g. 'A1'
access: | public

[ Top ]

### method getActiveSheet [line 201]

`PHPExcel_Worksheet getActiveSheet( )`

Get the currently active sheet. Only used for supervisor

#### Tags:

access: | public

[ Top ]

### method getBold [line 367]

`boolean getBold( )`

Get Bold

#### Tags:

access: | public

[ Top ]

### method getColor [line 580]

`PHPExcel_Style_Color getColor( )`

Get Color

#### Tags:

access: | public

[ Top ]

### method getHashCode [line 609]

`string getHashCode( )`

Get hash code

#### Tags:

return: | Hash code
access: | public

[ Top ]

### method getIsSupervisor [line 180]

`boolean getIsSupervisor( )`

Is this a supervisor or a real style component?

#### Tags:

access: | public

[ Top ]

### method getItalic [line 398]

`boolean getItalic( )`

Get Italic

#### Tags:

access: | public

[ Top ]

### method getName [line 305]

`string getName( )`

Get Name

#### Tags:

access: | public

[ Top ]

### method getSelectedCells [line 212]

`string getSelectedCells( )`

Get the currently active cell coordinate in currently active sheet.

Only used for supervisor

#### Tags:

return: | E.g. 'A1'
access: | public

[ Top ]

### method getSharedComponent [line 191]

`PHPExcel_Style_Font getSharedComponent( )`

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

Only used for style supervisor

#### Tags:

access: | public

[ Top ]

### method getSize [line 336]

`double getSize( )`

Get Size

#### Tags:

access: | public

[ Top ]

### method getStrikethrough [line 549]

`boolean getStrikethrough( )`

Get Strikethrough

#### Tags:

access: | public

[ Top ]

### method getStriketrough [line 529]

`boolean getStriketrough( )`

Get Striketrough

#### Tags:

deprecated: | Use getStrikethrough() instead.
access: | public

[ Top ]

### method getStyleArray [line 234]

`array getStyleArray( array $array)`

Build style array from subcomponents

#### Tags:

access: | public

#### Parameters:

array | $array |

[ Top ]

### method getSubScript [line 461]

`boolean getSubScript( )`

Get SubScript

#### Tags:

access: | public

[ Top ]

### method getSuperScript [line 429]

`boolean getSuperScript( )`

Get SuperScript

#### Tags:

access: | public

[ Top ]

### method getUnderline [line 493]

`string getUnderline( )`

Get Underline

#### Tags:

access: | public

[ Top ]

### method setBold [line 380]

`PHPExcel_Style_Font setBold( [boolean $pValue = false])`

Set Bold

#### Tags:

access: | public

#### Parameters:

boolean | $pValue |

[ Top ]

### method setColor [line 591]

`PHPExcel_Style_Font setColor( [PHPExcel_Style_Color $pValue = null])`

Set Color

#### Tags:

throws: | Exception
access: | public

#### Parameters:

PHPExcel_Style_Color | $pValue |

[ Top ]

### method setItalic [line 411]

`PHPExcel_Style_Font setItalic( [boolean $pValue = false])`

Set Italic

#### Tags:

access: | public

#### Parameters:

boolean | $pValue |

[ Top ]

### method setName [line 318]

`PHPExcel_Style_Font setName( [string $pValue = 'Calibri'])`

Set Name

#### Tags:

access: | public

#### Parameters:

string | $pValue |

[ Top ]

### method setSize [line 349]

`PHPExcel_Style_Font setSize( [double $pValue = 10])`

Set Size

#### Tags:

access: | public

#### Parameters:

double | $pValue |

[ Top ]

### method setStrikethrough [line 562]

`PHPExcel_Style_Font setStrikethrough( [boolean $pValue = false])`

Set Strikethrough

#### Tags:

access: | public

#### Parameters:

boolean | $pValue |

[ Top ]

### method setStriketrough [line 540]

`PHPExcel_Style_Font setStriketrough( [boolean $pValue = false])`

Set Striketrough

#### Tags:

deprecated: | Use setStrikethrough() instead.
access: | public

#### Parameters:

boolean | $pValue |

[ Top ]

### method setSubScript [line 474]

`PHPExcel_Style_Font setSubScript( [boolean $pValue = false])`

Set SubScript

#### Tags:

access: | public

#### Parameters:

boolean | $pValue |

[ Top ]

### method setSuperScript [line 442]

`PHPExcel_Style_Font setSuperScript( [boolean $pValue = false])`

Set SuperScript

#### Tags:

access: | public

#### Parameters:

boolean | $pValue |

[ Top ]

### method setUnderline [line 508]

`PHPExcel_Style_Font setUnderline( [string|boolean $pValue = self::UNDERLINE_NONE])`

Set Underline

#### Tags:

access: | public

#### Parameters:

string|boolean | $pValue | PHPExcel_Style_Font underline type If a boolean is passed, then true equates to UNDERLINE_SINGLE, false equates to UNDERLINE_NONE

[ Top ]

### method __clone [line 630]

`void __clone( )`

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

#### Tags:

access: | public

[ Top ]

### Class Constants

#### UNDERLINE_DOUBLE = 'double'

[line 40]

[ Top ]

#### UNDERLINE_DOUBLEACCOUNTING = 'doubleAccounting'

[line 41]

[ Top ]

#### UNDERLINE_NONE = 'none'

[line 39]

[ Top ]

#### UNDERLINE_SINGLE = 'single'

[line 42]

[ Top ]

#### UNDERLINE_SINGLEACCOUNTING = 'singleAccounting'

[line 43]

[ Top ]

Documentation generated on Fri, 12 Oct 2012 00:16:18 +0200 by phpDocumentor 1.4.4