102 $this->italic = null;
103 $this->superscript = null;
104 $this->subscript = null;
105 $this->underline = null;
106 $this->strikethrough = null;
113 $this->
color->bindParent($this,
'color');
125 return $this->
parent->getSharedComponent()->getFont();
137 return [
'font' => $array];
164 if ($this->isSupervisor) {
167 if (isset($pStyles[
'name'])) {
168 $this->
setName($pStyles[
'name']);
170 if (isset($pStyles[
'bold'])) {
171 $this->
setBold($pStyles[
'bold']);
173 if (isset($pStyles[
'italic'])) {
176 if (isset($pStyles[
'superscript'])) {
179 if (isset($pStyles[
'subscript'])) {
182 if (isset($pStyles[
'underline'])) {
185 if (isset($pStyles[
'strikethrough'])) {
188 if (isset($pStyles[
'color'])) {
189 $this->
getColor()->applyFromArray($pStyles[
'color']);
191 if (isset($pStyles[
'size'])) {
192 $this->
setSize($pStyles[
'size']);
206 if ($this->isSupervisor) {
222 if ($fontname ==
'') {
223 $fontname =
'Calibri';
225 if ($this->isSupervisor) {
229 $this->name = $fontname;
242 if ($this->isSupervisor) {
258 if (is_string($sizeInPoints) || is_int($sizeInPoints)) {
259 $sizeInPoints = (float) $sizeInPoints;
264 if (!is_float($sizeInPoints) || !($sizeInPoints > 0)) {
265 $sizeInPoints = 10.0;
268 if ($this->isSupervisor) {
269 $styleArray = $this->
getStyleArray([
'size' => $sizeInPoints]);
272 $this->
size = $sizeInPoints;
285 if ($this->isSupervisor) {
304 if ($this->isSupervisor) {
308 $this->bold = $pValue;
321 if ($this->isSupervisor) {
340 if ($this->isSupervisor) {
344 $this->italic = $pValue;
357 if ($this->isSupervisor) {
371 if ($this->isSupervisor) {
372 $styleArray = $this->
getStyleArray([
'superscript' => $pValue]);
375 $this->superscript = $pValue;
376 if ($this->superscript) {
377 $this->subscript =
false;
391 if ($this->isSupervisor) {
405 if ($this->isSupervisor) {
406 $styleArray = $this->
getStyleArray([
'subscript' => $pValue]);
409 $this->subscript = $pValue;
410 if ($this->subscript) {
411 $this->superscript =
false;
425 if ($this->isSupervisor) {
443 if (is_bool($pValue)) {
444 $pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE;
445 } elseif ($pValue ==
'') {
446 $pValue = self::UNDERLINE_NONE;
448 if ($this->isSupervisor) {
449 $styleArray = $this->
getStyleArray([
'underline' => $pValue]);
452 $this->underline = $pValue;
465 if ($this->isSupervisor) {
485 if ($this->isSupervisor) {
486 $styleArray = $this->
getStyleArray([
'strikethrough' => $pValue]);
489 $this->strikethrough = $pValue;
515 if ($this->isSupervisor) {
516 $styleArray = $this->
getColor()->getStyleArray([
'argb' =>
$color->getARGB()]);
532 if ($this->isSupervisor) {
539 ($this->bold ?
't' :
'f') .
540 ($this->italic ?
't' :
'f') .
541 ($this->superscript ?
't' :
'f') .
542 ($this->subscript ?
't' :
'f') .
544 ($this->strikethrough ?
't' :
'f') .
545 $this->
color->getHashCode() .
563 return $exportedArray;
setItalic($pValue)
Set Italic.
setColor(Color $pValue)
Set Color.
setSubscript(bool $pValue)
Set Subscript.
if(PHP_SAPI !='cli') color
setSize($sizeInPoints)
Set Size.
getUnderline()
Get Underline.
getStrikethrough()
Get Strikethrough.
getSelectedCells()
Get the currently active cell coordinate in currently active sheet.
getSuperscript()
Get Superscript.
getSharedComponent()
Get the shared style component for the currently active cell in currently active sheet.
setSuperscript(bool $pValue)
Set Superscript.
applyFromArray(array $pStyles)
Apply styles from array.
getSubscript()
Get Subscript.
setUnderline($pValue)
Set Underline.
getStyleArray($array)
Build style array from subcomponents.
__construct($isSupervisor=false, $isConditional=false)
Create a new Font.
const UNDERLINE_SINGLEACCOUNTING
setStrikethrough($pValue)
Set Strikethrough.
getIsSupervisor()
Is this a supervisor or a cell style component?
setName($fontname)
Set Name.
getActiveSheet()
Get the currently active sheet.
const UNDERLINE_DOUBLEACCOUNTING
getHashCode()
Get hash code.
setBold($pValue)
Set Bold.
exportArray2(array &$exportedArray, string $index, $objOrValue)
Populate array from exportArray1.