getStyle(); if (!$style instanceof FontStyle) { return ''; } $content = ''; $content .= $this->getValueIf($style->isRTL(), '\rtlch'); $content .= '\cf' . $this->colorIndex; $content .= '\f' . $this->nameIndex; $size = $style->getSize(); $content .= $this->getValueIf(is_numeric($size), '\fs' . round($size * 2)); $content .= $this->getValueIf($style->isBold(), '\b'); $content .= $this->getValueIf($style->isItalic(), '\i'); $content .= $this->getValueIf($style->getUnderline() != FontStyle::UNDERLINE_NONE, '\ul'); $content .= $this->getValueIf($style->isStrikethrough(), '\strike'); $content .= $this->getValueIf($style->isSuperScript(), '\super'); $content .= $this->getValueIf($style->isSubScript(), '\sub'); return $content . ' '; } /** * Set font name index. * * @param int $value */ public function setNameIndex($value = 0): void { $this->nameIndex = $value; } /** * Set font color index. * * @param int $value */ public function setColorIndex($value = 0): void { $this->colorIndex = $value; } }