Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

(no description)

File Size: 556 lines (13 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Font:: (23 methods):
  __construct()
  getSharedComponent()
  getStyleArray()
  applyFromArray()
  getName()
  setName()
  getSize()
  setSize()
  getBold()
  setBold()
  getItalic()
  setItalic()
  getSuperscript()
  setSuperscript()
  getSubscript()
  setSubscript()
  getUnderline()
  setUnderline()
  getStrikethrough()
  setStrikethrough()
  getColor()
  setColor()
  getHashCode()


Class: Font  - X-Ref

__construct($isSupervisor = false, $isConditional = false)   X-Ref
Create a new Font.

param: bool $isSupervisor Flag indicating if this is a supervisor or not
param: bool $isConditional Flag indicating if this is a conditional style or not

getSharedComponent()   X-Ref
Get the shared style component for the currently active cell in currently active sheet.
Only used for style supervisor.

return: Font

getStyleArray($array)   X-Ref
Build style array from subcomponents.

param: array $array
return: array

applyFromArray(array $pStyles)   X-Ref
Apply styles from array.

<code>
$spreadsheet->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray(
[
'name' => 'Arial',
'bold' => TRUE,
'italic' => FALSE,
'underline' => \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE,
'strikethrough' => FALSE,
'color' => [
'rgb' => '808080'
]
]
);
</code>

param: array $pStyles Array containing style information
return: Font

getName()   X-Ref
Get Name.

return: string

setName($pValue)   X-Ref
Set Name.

param: string $pValue
return: Font

getSize()   X-Ref
Get Size.

return: float

setSize($pValue)   X-Ref
Set Size.

param: float $pValue
return: Font

getBold()   X-Ref
Get Bold.

return: bool

setBold($pValue)   X-Ref
Set Bold.

param: bool $pValue
return: Font

getItalic()   X-Ref
Get Italic.

return: bool

setItalic($pValue)   X-Ref
Set Italic.

param: bool $pValue
return: Font

getSuperscript()   X-Ref
Get Superscript.

return: bool

setSuperscript($pValue)   X-Ref
Set Superscript.

param: bool $pValue
return: Font

getSubscript()   X-Ref
Get Subscript.

return: bool

setSubscript($pValue)   X-Ref
Set Subscript.

param: bool $pValue
return: Font

getUnderline()   X-Ref
Get Underline.

return: string

setUnderline($pValue)   X-Ref
Set Underline.

param: bool|string $pValue \PhpOffice\PhpSpreadsheet\Style\Font underline type
return: Font

getStrikethrough()   X-Ref
Get Strikethrough.

return: bool

setStrikethrough($pValue)   X-Ref
Set Strikethrough.

param: bool $pValue
return: Font

getColor()   X-Ref
Get Color.

return: Color

setColor(Color $pValue)   X-Ref
Set Color.

param: Color $pValue
return: Font

getHashCode()   X-Ref
Get hash code.

return: string Hash code